i have a jPanel containing 3 menus--lets call it MenuPanel i place it on the top of my jFrame (border_layout top). i have also 3 jPanels (PanelOne, PanelTwo, PanelThree) and i want it to be showed on the bottom of the jFrame (border_layout bottom) based on the menu that the user choose
Simple solution: use a CardLayout to help you swap JPanels.
show(cardHolderPanel, APPROPRIATE_STRING_CONSTANT)
on your CardLayout. Tutorial: http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.