Click to See Complete Forum and Search --> : JList problem


Zerg
May 9th, 2000, 03:16 AM
help me !
i have read through the JDK specifications but it doesn't tell me how to
1) get all contents in a JList
2) remove one or all contents in a JList.
3) add a value to a JList during runtime
4) sort the contents in the JList

why ?

pls help


Signature (up to 100 characters) You may use Markup in your signature

Franklin
June 12th, 2000, 02:41 PM
You must do this through the JList's model.

To do an update to the model, you must extends DefaultListModel and then expose the fireContentsChanged methods since they are protected. You can get the ListModel by making a call to getListModel on the JList.