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?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.