sliding window under a JPanel

2019-08-16 17:36发布

I have a JPanel and I want it so that whenever a user clicks on it, a sliding window appears just below the panel and giving more information to what is already in the JPanel. How can I do this?

4条回答
Summer. ? 凉城
2楼-- · 2019-08-16 18:09

To put something on something, you can use a JLayeredPane or the zorder thing.

查看更多
萌系小妹纸
3楼-- · 2019-08-16 18:19

Perhaps add a mouselistener to the jpanel, then upon mousepressed add an inner panel, or pull up a different card, or do whatever it is that works for your particular swing layout.

查看更多
迷人小祖宗
5楼-- · 2019-08-16 18:24

The requirements of your question are terrible so we can't give much detail.

If you want to to animation then use a Swing Timer. Each time the timer fires you change the height of the component to make it look likes its sliding.

查看更多
登录 后发表回答