-1

谁能给我一个例子,说明如何将一个确定大小的面板放在 JFrame 内另一个确定大小的面板上?

我的意思是这样的

-------------------
|                 |
|       Panel 1   |      
|                 | 
|                 |
-------------------
|                 |
|      Panel 2    |                                         
-------------------
4

2 回答 2

1

Read the section from the Swing tutorial on Layout Managers. There are several you can choose from. BorderLayout may be the easiest as it does automatic resizing of the width.

Note that you should not be hardcoding sizes. Let the layout manager determine the size.

于 2013-06-21T19:54:27.210 回答
1

看看JSplitPane Swing 组件。

我建议您阅读How to use Split Panes和来自 camickr 答案的布局管理器链接

于 2013-06-21T20:01:48.490 回答