Getting JScrollPane to work with a long JList

Had a quick wrestle with getting the scrollbars of a Java JScrollPane to show up with a long JList with a couple of wide options. It was being pretty stubborn until I realized that resetting the minimum and preferred size of both components was causing the issue. As soon as I reverted back to the default minimum and preferred sizes on the JList, sizing the JScrollPane smaller than the JList got the scrollbars to show up just fine.

Comments

Popular Posts