Forums Register Login

JScrollPane getting full, but not scrolling?

+Pie Number of slices to send: Send
I am trying to create a JScrollPane with buttons in it, but I noticed that when I try to scroll, the items all move into ONE row at the top of the JScrollPane. How do I have them vertical? Is there something wrong with the way I am setting up the JScrollPane? Thanks
+Pie Number of slices to send: Send
Changed original post.
+Pie Number of slices to send: Send
I figured out how - to set the preferred size of the JPanel instead of the JScrollPane.
1
+Pie Number of slices to send: Send
No. Don't set the preferred size of anything. Swing was designed to be used with Layout Managers. Let the layout managers do their job and you won't have problems.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 513 times.
Similar Threads
How to use TableCellRenderer for JButton.class
Help with simple GUI layout
Displaying Splash Screen in NetBeans
Print Text
Problem(s) with GridBagLayout - more confused
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:47:20.