Java Chat Client.. using .add methood [closed]

Use ListModel if you want to change the content of a JList dynamically.

DefaultListModel listModel = new DefaultListModel();
JList list = new JList(listModel);
listModel.addElement("item");
listModel.addElement("another item");

Browse More Popular Posts

Leave a Comment