Java examples for Swing:JList
Create a JList using a Vector
import java.util.Vector; import javax.swing.JList; public class Main { public static void main(String[] args) { Vector<String> items2 = new Vector<>(4); items2.add("Spring"); items2.add("Summer"); items2.add("Fall"); items2.add("Winter"); JList<String> list2 = new JList<>(items2); }/*www . j a va2s . c o m*/ }