我想制作一个特定的网格,但我不确定如何制作
-------------------------------------------
| |
| | <-- My Banner
| |
-------------------------------------------
| | |
| Panel1 | |
| | |
-----------------------| |
| | |
| Panel2 | | <--Info or something. I want this space to be
| | | a white area. Im going to put images here.
-----------------------| |
| | |
| Panel3 | |
| | |
-------------------------------------------
所以我想知道我应该使用什么版面管理器?
答案 0 :(得分:0)
这会给你你想要的结果:
final JPanel mainPanel = new JPanel(new BorderLayout());
final JPanel bottomLeftPanel = new JPanel(new GridLayout(3, 1));
//add 3 panels to bottomLeftPanel
final JPanel bottomRightPanel = new JPanel(new BorderLayout());
final JPanel bottomPanel = new JPanel(new GridLayout(1, 2));
bottomPanel.add(bottomLeftPanel);
bottomPanel.add(bottomRightPanel);
final JPanel topPanel = new JPanel(new BorderLayout());
mainPanel.add(bottomPanel, BorderLayout.CENTER);
mainPanel.add(topPanel, BorderLayout.NORTH);