Forums Register Login

Problem with scrollbars in JList

+Pie Number of slices to send: Send
Hi!
I have a JTabbedPane which contains three JPanes. One of the JPanes contains another JPane and there's a JList. I created the JScrollPane for the list like this:

The vertical scrollbar should be always visible but it's not even if there's too much stuff in the list. None of the scrollbars are shown.
I also tried to set the viewport of the scrollpane manually but it didn't work either:

The layout of the JPane (which contains the JList and the JScrollPane) is set to null, I placed the components with setBounds() method. Selection model of the JList is set to ListSelectionModel.SINGLE_SELECTION.
Any suggestions?
+Pie Number of slices to send: Send
hi,
When the layout is null , u need to set the Bounds for ScrollPane , no need for List ,
can u post the whole code ,becoz the form in which u have initialised the ScrollPane is correct
keerthi
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1452 times.
Similar Threads
How to only list sub directories in JList?
How to only list sub directories in JList?
Scrolling in Java
Regarding JList- Combobox Swing
linking items to different jpanes/windows
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:23:09.