问题
I am creating desktop application and design using Swing. i have two panels in frame left and right panel, In the left panel I have buttons, So i want that when i click on button from left panel it should display the result in right panel on same frame. Does i need to create another frame with same left panel and create a right panel for the link , or there is a way for above written method have no idea that how to do this. Like Shown in below Image.
回答1:
I'd lay it out like this (there are other ways as well).
Logically
BorderLayout
GridBagLayout
(LINE_START
)GridLayout
- Button 1
- Button 2
- Button 3
- Button 4
CardLayout
(CENTER
)- card Panel 1
- card Panel 2
- card Panel 3
- card Panel 4
Visually
来源:https://stackoverflow.com/questions/46483075/swing-vertical-navigation-menu