protected Component buildMainPanel() {
   JList list = SwingComponentFactory.buildList(this.primaryKeysModel);
   list.setSelectionModel(this.primaryKeysSelectionModel);
   list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
   list.setCellRenderer(this.buildListCellRenderer());
   list.addMouseListener(buildListMouseListener());
   return new JScrollPane(list);
 }
コード例 #2
0
    protected Component buildPage() {
      JList listBox = SwingComponentFactory.buildList(this.buildSelectedNodesListModel());
      listBox.setBorder(BorderFactory.createEmptyBorder());
      listBox.setCellRenderer(new DisplayableListCellRenderer());

      listBox.setBackground(UIManager.getColor("Panel.background"));
      listBox.setForeground(UIManager.getColor("List.foreground"));
      listBox.setSelectionBackground(UIManager.getColor("ScrollPane.background"));
      listBox.setSelectionForeground(listBox.getForeground());

      JScrollPane scrollPane = new JScrollPane(listBox);
      scrollPane.setBorder(new EmptyBorder(5, 0, 0, 0));
      scrollPane.getVerticalScrollBar().setUnitIncrement(10);
      scrollPane.setViewportBorder(BorderFactory.createEmptyBorder());

      return scrollPane;
    }