Reputation: 41
My program creates a series of JScrollPanes each containing a JList. The JList displays vertically and each one has a fixed number of lines. The initial size of the container they are in isn't big enough to display the complete JList, thus the scrollpane, but can be resized.
I want each JScrollPane to stop growing when it reaches a size sufficient to display the complete JList.
I've tried setting the JList SetVisibileRowCount and then setting the ScrollPane's MaximumSize to the MaximumSize of the JList, but it seems to have no affect.
Any suggestions?
Upvotes: 1
Views: 6904