wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes in flow lay out how can i force to add component on next line? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "in flow lay out how can i force to add component on next line?" Watch "in flow lay out how can i force to add component on next line?" New topic
Author

in flow lay out how can i force to add component on next line?

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Hey Ranchar i would like to know one thing that as we know that flow lay out arrange component from left to right and work as word wrapping feature of ms word well but i want by flow lay out that after adding two component next component should be added on the next line how can i accomplise that ?

Regard

Arun
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
You can't.

ok, nothing is impossible and there are some creative ways (read: "hacks") I can think of that might force FlowLayout to do something like this. But the easiest way to achieve the effect you want is to have two nested Containers within your Container. It would look something like this:



bitguru blog
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
I guess you can set the preferredSize to your FlowLayout panel. When the next is added to the panel it's added on a new row.
[ January 08, 2007: Message edited by: Mathias Nilsson ]

SCJP1.4
Pavan Kumar
Greenhorn

Joined: Jan 05, 2007
Posts: 10
Yep

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: in flow lay out how can i force to add component on next line?