Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to make FlowLayout *Flow*?

843804Jun 17 2004 — edited Feb 24 2005
I'm having trouble getting FlowLayout to flow as it claims it does. Any help is greatly appreciated:
JPanel panel = new JPanel(); // default flow layout
JScrollPane scroll = new JScrollPane(panel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
My problem is that regardless of the number of items added to the panel, it never flows onto a second line. Instead, the panel is resized horizontally beyond the viewport size and the additional items are not visible.

Again, any suggestions are greatly appreciated!

Thanks,
Brian.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2005
Added on Jun 17 2004
6 comments
296 views