sliding window under a JPanel

狂风中的少年 提交于 2019-12-13 03:39:57

问题


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?


回答1:


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




回答2:


Try this http://java-sl.com/tip_slider.html




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/4218117/sliding-window-under-a-jpanel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!