0

我有一个我想制作的特定网格,但我不知道如何制作它

-------------------------------------------
|                                         |
|                                         | <-- My Banner
|                                         |
-------------------------------------------
|                      |                  |
|      Panel1          |                  |
|                      |                  |
-----------------------|                  |
|                      |                  |
|      Panel2          |                  | <--Info or something. I want this space to be
|                      |                  |    a white area. Im going to put images here.
-----------------------|                  |
|                      |                  |
|      Panel3          |                  |
|                      |                  |
-------------------------------------------

所以我想知道我应该使用什么布局管理器?

4

1 回答 1

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);
于 2013-08-17T05:12:23.433 回答