UNable to add elements in jlist
in constructor
getting jlist blank
following is my code :
private Server ser=null; Thread my=null; DefaultListModel clients= new DefaultListModel(); public UIServer(Server ser) { initComponents(); this.ser=ser; setVisible(true); clients = new DefaultListModel(); for(int i=0;i<=ser.clientsNames.length-1;i++) { clients.addElement(ser.clientsNames[i]); } lstClient = new JList(clients); lstClient.setModel(clients); my= new Thread(this); //my.start(); }
I debugged and im getting values in list model and im using netbeans IDE