List of utility methods to do JTable Cell Editor
void | setClickCountToStartEditing(JTable table, int count) set Click Count To Start Editing for (int columnIndex = 0; columnIndex < table.getColumnCount(); ++columnIndex) { TableCellEditor cellEditor = table.getColumnModel().getColumn(columnIndex).getCellEditor(); if (cellEditor instanceof DefaultCellEditor) { ((DefaultCellEditor) cellEditor).setClickCountToStart(count); |
void | setClickCountToStartEditing(JTable table, int count) set Click Count To Start Editing ((DefaultCellEditor) table.getDefaultEditor(String.class)).setClickCountToStart(count);
|
void | setDefaultTableEditorsClicks(JTable table, int clickCountToStart) setDefaultTableEditorsClicks, This sets the number of clicks required to start the default table editors in the supplied table. TableCellEditor editor; editor = table.getDefaultEditor(Object.class); if (editor instanceof DefaultCellEditor) { ((DefaultCellEditor) editor).setClickCountToStart(clickCountToStart); editor = table.getDefaultEditor(Number.class); if (editor instanceof DefaultCellEditor) { ((DefaultCellEditor) editor).setClickCountToStart(clickCountToStart); ... |
void | setEditable(JSpinner spinner, boolean bool) Make the spinner text field editable, or not JSpinner.DefaultEditor editor; editor = (JSpinner.DefaultEditor) spinner.getEditor(); editor.getTextField().setEditable(bool); |
void | setEditable(JTextComponent component, boolean editable) set Editable component.setEditable(editable); component.setBackground(editable ? NORMAL_BG : NOT_EDITABLE_BG); |
void | setEditable(JTextComponent... components) set Editable for (JTextComponent component : components) {
component.setEditable(true);
|
void | setEditableFalse(JTextField field) Set text field non-editable. field.setEditable(false); field.setFocusable(false); |
void | setUneditable(JTextComponent... components) set Uneditable for (JTextComponent component : components) {
component.setEditable(false);
|
void | setupComboBoxEditor(TableColumn column, Object[] values) setup Combo Box Editor DefaultComboBoxModel model = new DefaultComboBoxModel(values); JComboBox comboBox = new JComboBox(model); comboBox.setEditable(false); column.setCellEditor(new DefaultCellEditor(comboBox)); if (values.length > 1) { comboBox.setSelectedIndex(0); |
void | stopCellEditing(JTable table) stop Cell Editing if (table != null) { TableCellEditor editor = table.getCellEditor(); if (editor != null) { if (editor instanceof DefaultCellEditor) { ((DefaultCellEditor) editor).stopCellEditing(); |