Я делаю Jlist в Netbeans, и я написал код, но код исчезает не в моем Jlist
/** Creates new form Toetsenbordd */
public Toetsenbordd() {
initComponents();
initCustomComponents();
}
private void initCustomComponents(){
JList Lijstje;
JScrollPane Lijst;
String filename[]= {"Ard ","Astronauts",
"Behind the Scene Movie credits","DNA Research -- the Human Genome Project",
"Extract from The Adventures of Pinocchio","History of Photography",
"Hubble Space Telescope","Legends of Abraham Lincoln","Netiquette",
"Observations of the Father of Computing (1791 - 1871)","Rules of Baseball (from 1889)",
"Speeding up the strategy process","Stinging Insects","The Eight Tools for Creating New Values",
"The Life of Calamity Jane","The Little Match Girl (adapted)","The Tail of Peter Rabbit",
"Thoughts of Banjamin Franklin","What is the Cast","Yosemite National Park"
};
{
Lijstje = new JList(filename);
Lijstje.setFont(new Font("Arial",Font.PLAIN,15));
Lijst =new JScrollPane(Lijstje);
Lijst.setSize(410,200);
Lijst.setLocation(70,75);
Lijstje.setVisibleRowCount(6);
Lijstje.setSelectedIndex(0);
Lijstje.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
//seting the border for filescroll
Lijst.setBorder(BorderFactory.createTitledBorder("CHOOSE TEST"));
add(Lijst);
}
}
Он стоит в середине моего самодельного Jframe:
Но я хочу это там, где написано пункт 1,2,3