JTable myTable = new javax.swing.JTable() { public void changeSelection(final int row, final int column, boolean toggle, boolean extend) { super.changeSelection(row, column, toggle, extend); myTable.editCellAt(row, column); myTable.transferFocus(); } };
public void actionPerformed(ActionEvent e) { tblNames.transferFocus(); } });
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == fixedTable) fixedTable.transferFocus(); mainTable.changeSelection(mainTable.getSelectedRow(), mainTable.getColumnCount() - 1, false, false); } }
@Override public void actionPerformed(ActionEvent e) { int row = table.getSelectedRow(); if (row < table.getRowCount() - 1) { table.changeSelection(row + 1, 0, false, false); } else { table.clearSelection(); table.transferFocus(); } } });
public void actionPerformed(ActionEvent e) { data.add(""); model.fireTableDataChanged(); dialog.table.changeSelection(data.size() - 1, 0, false, false); dialog.table.editCellAt(data.size() - 1, 0); dialog.table.transferFocus(); } });
@Override public void actionPerformed(ActionEvent e) { if (fixedTable.getSelectedColumn() == fixedTable.getColumnCount() - 1) { fixedTable.transferFocus(); mainTable.changeSelection(fixedTable.getSelectedRow(), 0, false, false); } else { fixedTableNextColumnCellAction.actionPerformed(e); } } }
@Override public void actionPerformed(ActionEvent e) { if (fixedTable.getSelectedColumn() == 0) { fixedTable.transferFocus(); mainTable.changeSelection(previousRow(mainTable), mainTable.getColumnCount() - 1, false, false); } else { fixedTablePrevColumnCellAction.actionPerformed(e); } } }
/** * {@inheritDoc} * <p> * Overridden to try to stop the edit, if appropriate. Calls super if * succeeded, does not yield otherwise. * */ @Override public void transferFocus() { if (isEditingFocusCycleRoot() && !getCellEditor().stopCellEditing()) return; super.transferFocus(); }
/** * {@inheritDoc} * <p> * Overridden to try to stop the edit, if appropriate. Calls super if * succeeded, does not yield otherwise. * */ @Override public void transferFocus() { if (isEditingFocusCycleRoot() && !getCellEditor().stopCellEditing()) return; super.transferFocus(); }
/** * {@inheritDoc} * <p> * Overridden to try to stop the edit, if appropriate. Calls super if * succeeded, does not yield otherwise. * */ @Override public void transferFocus() { if (isEditingFocusCycleRoot() && !getCellEditor().stopCellEditing()) return; super.transferFocus(); }
/** * {@inheritDoc} * <p> * Overridden to try to stop the edit, if appropriate. Calls super if * succeeded, does not yield otherwise. * */ @Override public void transferFocus() { if (isEditingFocusCycleRoot() && !getCellEditor().stopCellEditing()) return; super.transferFocus(); }
/** * {@inheritDoc} * <p> * Overridden to try to stop the edit, if appropriate. Calls super if * succeeded, does not yield otherwise. * */ @Override public void transferFocus() { if (isEditingFocusCycleRoot() && !getCellEditor().stopCellEditing()) return; super.transferFocus(); }
panel.entryTable.changeSelection(newRow, panel.entryTable.getColumnCount() - 1, false, true); panel.entryTable.editCellAt(newRow, 0); panel.entryTable.transferFocus(); }); panel.removeEntryButton.addActionListener(e -> {