示例#1
0
    /** @param e */
    public void actionPerformed(ActionEvent e) {
      JListMutable list = (JListMutable) e.getSource();
      if (!list.hasFocus()) {
        CellEditor cellEditor = list.getListCellEditor();
        if ((cellEditor != null) && !cellEditor.stopCellEditing()) {
          return;
        }
        list.requestFocus();

        return;
      }
      ListSelectionModel rsm = list.getSelectionModel();
      int anchorRow = rsm.getAnchorSelectionIndex();
      list.editCellAt(anchorRow, null);
      Component editorComp = list.getEditorComponent();
      if (editorComp != null) {
        editorComp.requestFocus();
      }
    }
示例#2
0
 /** @param e */
 public void actionPerformed(ActionEvent e) {
   JListMutable list = (JListMutable) e.getSource();
   list.removeEditor();
 }