Saturday, 15 June 2013

java - JList not showing items -


I have some problems showing the objects of a jellist.

  DefaultListModel & lt; String & gt; Model = New DefaultListModel & lt; String & gt; (); Model.addElement ("A"); Model.addElement ("two"); Model.addElement ("three"); List = new jellist & lt; String & gt; (Model); List.setCellRenderer (new DefaultListCellRenderer ()); List.setVisible (true);  

I also tried without even setting ListCellRenderer , yet no luck.

Can you suggest me what I am doing?

Thanks to your anwsers and comments the problem was that no list item was shown.

In the future, I will add a minimum compatible program.

My problem was trying to add JPN one JDialog to the constructor, but JPanel at this time Null because it was initiated in createUIComponents method.

An early begun to apologize to you.


No comments:

Post a Comment