layout manager JPanel 的default layout manager是Flowlayout In addition there exists BorderLayout, GridLayout and CardLayout You can set the manager just like below: JPanel myPanel = new JPanel(); myPanel.setLayout(new BorderLayout()); or: JPanel myPanel = new JPanel(new BorderLayout()); I suggest you find a book about GUI to read. After that you'll find it's easy!
I'm sorry about my careless. Perhaps I distort the real meaning of your question.
JPanel 的default layout manager是Flowlayout
In addition there exists BorderLayout, GridLayout and CardLayout
You can set the manager just like below:
JPanel myPanel = new JPanel();
myPanel.setLayout(new BorderLayout());
or:
JPanel myPanel = new JPanel(new BorderLayout());
I suggest you find a book about GUI to read.
After that you'll find it's easy!
Perhaps I distort the real meaning of your question.