List of usage examples for javax.swing JList setValueIsAdjusting
public void setValueIsAdjusting(boolean b)
From source file:Main.java
public static void main(final String args[]) { String labels[] = { "A", "B", "C", "D", "E" }; JFrame frame = new JFrame("Sizing Samples"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JList jlist1 = new JList(labels); jlist1.setVisibleRowCount(4);//from ww w . j a v a 2 s .com JScrollPane scrollPane1 = new JScrollPane(jlist1); frame.add(scrollPane1, BorderLayout.NORTH); jlist1.setValueIsAdjusting(false); frame.setSize(300, 350); frame.setVisible(true); }