Java Swing JList -
I am using a jellist in Java swing, but when my dialog opens, the list is not displayed.
Private JLITs (Zest) (if (MyList == blank) {mylist = New Jellist ()); Mylist.setSelectionMode (ListSelectionModel.SINGLE_SELECTION); Mylist.setSize (new dimension (154, 106)); Model.addElement ("test"); Model.addElement ("Zwei"); Mylist.setVisible (true); } Return my marital status; }
The list is defined:
Private JPanel getJContentPane () {if (jContentPane == zero) {jContentPane = new JPanel (); JContentPane.setLayout (new border layout ()); JContentPane.add (getJList (), border layout .ca); } Return jContentPane; }
This is a JContentPane (/ panel)
Public Fenestrae (frame owner) {super}; Start (); }
code calling getJContentPane ()
:
private zeros start () {this.setSize (300, 200); This.setContentPane (getJContentPane ()); This.setTitle ("Auswahl"); }
I do not know where you're setting up JList models?
Something like this
mylist = new JList (); Mylist.setModel (model); Please take a look at fensterdrei FensterDrei
Mylist
myList
Comments
Post a Comment