Forums Register Login

JList width

+Pie Number of slices to send: Send
I have a JList inside a ScrollPane. I set the vertical size by using the .setVisibleRowCount method, so now the height is always the same height, and when the number of options is large enough, it scrolls. I want to do the same kind of thing to the width, but I looked in the JList API and didn't see anything that seems to work. The width keeps changing depending on what is in the list. How can I set the width?
+Pie Number of slices to send: Send
give the scrollpane a preferredSize
e.g.
scrollPane.setPreferredSize(new Dimension(100,200));
+Pie Number of slices to send: Send
Thank you.
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3867 times.
Similar Threads
SpringLayout - handcoding
org.eclipse.swt.widgets.List - how to set visibile row count?
buttons display problem in IE and FireFox
Different cell sizes for jlist cells
howto fix the size of table ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:55:05.