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