Fill up the empty space of a FlowLayout

Soler Mani picture Soler Mani · Mar 2, 2012 · Viewed 8.8k times · Source

I have a flowlayout panel which has a textfield inside. Although the textfield is not that wide but I want to place components on the next line. How do I fill the remaining space with an empty box?

Answer

Eng.Fouad picture Eng.Fouad · Mar 2, 2012

Fill it with empty JPanel:

new JPanel();