java - Make JScrollPane display scrollbars when JList inside is changed -
I'm trying to change in the dynamically JScrollPane a Jeselais,
MyList setListData (someArray); Then I hope I hope the show needed scrollbar to JScrollPane, but it does not. This issue Gogling was not very helpful, I tried various combinations of these methods, with a lot of success (basically API Poking) through Docs:
myScrollPane.setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ); MyList.validate (); MyScrollPane.validate (); MyScrollPane.setPreferredSize (some dimension dimensions); MyScrollPane.setViewportView (moduleList); MyScrollPane.setLayout (...); Time is a scrollbar appears when you use the first method, but this model does not activate the change. I bowed down at PropertyChangeEvent and confirmed that the jellist fire and the incident when the model changed what I do not understand here? What method do I have to use to do this work, or even better, can this work out of the property box?
If set to favorite SEL Jeelais, even (0, 0), then Jeskrolpan not working Set up - Make sure that it is unset, set if necessary (set)
View as
Resolve this problem JList's preferred set set not (setting statement removal) of ethnic Jeelaist changing favorite cyst in Netbins IDE 5.5.1, Jeelais Dedi sim can be obtained by right clicking on property and then selecting "Restore default value".
In closing, JScrollPane only. Do not set JList's preferred size.
Comments
Post a Comment