Two Different Panels in One Frame - Java(一帧中的两个不同面板 - Java)
问题描述
I have a question. I have one main frame, and to the left i have a sidebar with menus. My question is, is it possible to make another panel within the main frame, so that if menu1 is clicked, the related contents should be displayed to the second half of the main frame, and when other menus are pressed then obviously the relevant stuff according to what is selected. its a bit hard to explain, sorry. Has anyone got an idea, whether that is possible in Java with Eclipse?
yes this's pretty possible you have look at CardLayout, this LayoutManager could be provide the simple way how to implement switching betweens JPanel in the JFrame
这篇关于一帧中的两个不同面板 - Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!