Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting boundaries for a JScrollPane

Status
Not open for further replies.

jeremytaffy

Technical User
Sep 6, 2001
75
US
I created a JPanel named "Row1" that had a flowlayout.
I then created a JScrollPane by using the following command:

JScrollPane scroll1 = new JScrollPane(row1, ....);

I added "scroll1" to the container I'm working on.

The problem is that I have several buttons on row1 that I want to use. However, the buttons keep flowing to the right when "scroll1" is added to the container instead of starting again on a new line when the line is full. Is there any way to set some boundary so that the buttons would flow as usual even if a ScrollPane is added?

Please Let me know. Thanks.
 
Have you tried the methods - setPreferredSize(), setMaximumSize(), setMinimumSize() ?

These control the Layout Manager packing rules.

RjB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top