I want to know how to use a Layout Manager (FlowLayout), but not in the full window, only in a part of my window.

Look at the image

enter image description here

This part is on the blue line.

Only these labels must be under the effect of FlowLayout. The rest of the components are manually setted by me.

Can you help me?

PS.: Sorry for some grammar mistakes, I don't speak English very well.

有帮助吗?

解决方案

You would need to make multiple panels and add those panels to different parts of the JFrame (for ex. the top part would be add(panel1, BorderLayout.NORTH), the middle add(panel2, BorderLayout.CENTER) etc.)

Then you would just set the layout manager for panel2 (or whatever you name the middle panel) to have a flow layout and only add the components you want in the middle to that panel.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top