Java Code Examples for javax.swing.CellEditor

The following examples show how to use javax.swing.CellEditor. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void actionPerformed(ActionEvent e) {
  JTable table = (JTable)e.getSource();
  if (!table.hasFocus()) {
    CellEditor cellEditor = table.getCellEditor();
    if (cellEditor != null && !cellEditor.stopCellEditing()) { return; }
  ListSelectionModel rsm = table.getSelectionModel();
  int anchorRow = rsm.getAnchorSelectionIndex();
  table.editCellAt(anchorRow, PropertySheetTableModel.VALUE_COLUMN);
  Component editorComp = table.getEditorComponent();
  if (editorComp != null) {
Example 2
Source Project: ramus   Source File:    License: GNU General Public License v3.0 5 votes vote down vote up
public TableEditorTable(List<Attribute> attributes, GUIFramework framework) {
    this.framework = framework;
    this.attributes = attributes;
    plugins = new AttributePlugin[attributes.size()];
    cellEditors = new TableCellEditor[plugins.length];
    cellRenderers = new TableCellRenderer[plugins.length];

            KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
            KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
    AbstractAction ramusEnterAction = new AbstractAction() {

        private static final long serialVersionUID = 4745861738845278043L;

        public void actionPerformed(ActionEvent ae) {
            CellEditor editor = getCellEditor();
            if (editor != null)

    getActionMap().put("RamusENTER_Action", ramusEnterAction);