java refreshing an array into jList
OK so I have a JList and the content is provided with an array. I know how to add elements to an array but I want to know how to refresh a JList... or is it even possible? I tried Google. :\ import java.applet.Applet; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class bs extends JApplet implements MouseListener { public static String newline; public static JList list; public void init() { String[] data = {"one", "two", "three", "four"}; list = new JList(data); this.getContentPane().add(list); list.addMouseListener(this); String newline = "\n"; list.setVisible(true);