Tricky setup of jList
-
private JScrollPane jScrollPane = new JScrollPane();
-
private DefaultListModel jListModel = new DefaultListModel();
-
private JList jList1 = new JList();
-
-
...
-
-
in init:
-
jList1.setModel(jListModel);
-
jList1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
-
jList1.setLayoutOrientation(jList1.VERTICAL);
-
jList1.setVisibleRowCount(-1);
-
-
jScrollPane.add(jList1);
-
jScrollPane.getViewport().add(jList1, null);
-
jScrollPane.setPreferredSize(new Dimension(250, 80));
RJM Article Type
Work Notes