April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Exemplo de Scrollable JList
nJFrame f = new JFrame("Teste");
nf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
nString[] nomes = {“Alan Sommerer", “Alison Huml",
n                  “I Steele", “Kathy Walrath",
n                  “Sharon Zakhour"};
nJList list = new JList(nomes);
nlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
nlist.setLayoutOrientation(JList.HORIZONTAL_WRAP);
nlist.setVisibleRowCount(-1);
n...
nJScrollPane listScroller = new JScrollPane(list);
nlistScroller.setPreferredSize(new Dimension(250, 80));
nf.getContentPane().add(listScroller);
nf.pack();
nf.setVisible(true);
n
n
n                                                                       ListDemo