1

I was wondering what layout or hack could be used to position these two JPanels so that it would end up looking like this?

enter image description here

It seems like most layouts depend on the position of other components and either positions them vertically or horizontally in respect to the other components.

Note: Panel 2 is smaller than panel 1.

4

1 回答 1

3

I would use the BoxLayout layout manager in combination with Box. But there are several other options. This is just my personal preference.

For more information, please see How to Use BoxLayout.

于 2013-03-02T04:11:19.530 回答