sorry my code is for the main.java… I want to call one of the sample java file.
jList001 is one of those file.
inside the code for jList001.java has the following code
import javax.swing.*;
public class jList001
{
jList001(){
JFrame f= new JFrame();
DefaultListModel<String> l1 = new DefaultListModel<>();
l1.addElement("Item1");
l1.addElement("Item2");
l1.addElement("Item3");
l1.addElement("Item4");
JList<String> list = new JList<>(l1);
list.setBounds(100,100, 75,75);
f.add(list);
f.setSize(400,400);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String args[])
{
new jList001();
}
}