Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing
Class DefaultCellEditor

    java.lang.Object
      |
      +--javax.swing.DefaultCellEditor

public class DefaultCellEditor
extends java.lang.Object
implements TableCellEditor, TreeCellEditor, java.io.Serializable

The default editor for table and tree cells.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.

See Also:
  Serialized Form

Inner Class Summary
`protected class` | `DefaultCellEditor.EditorDelegate`

Field Summary
`protected ChangeEvent` | `changeEvent`
`protected int` | `clickCountToStart`
`protected DefaultCellEditor.EditorDelegate` | `delegate`
`protected JComponent` | `editorComponent`
`protected EventListenerList` | `listenerList` Event listeners

Constructor Summary
`DefaultCellEditor(JCheckBox x)` Constructs a DefaultCellEditor object that uses a check box.
`DefaultCellEditor(JComboBox x)` Constructs a DefaultCellEditor object that uses a combo box.
`DefaultCellEditor(JTextField x)` Constructs a DefaultCellEditor that uses a text field.

Method Summary
`void` | `addCellEditorListener(CellEditorListener l)`
`void` | `cancelCellEditing()`
`protected void` | `fireEditingCanceled()`
`protected void` | `fireEditingStopped()`
`java.lang.Object` | `getCellEditorValue()`
`int` | `getClickCountToStart()` clickCountToStart controls the number of clicks required to start editing if the event passed to isCellEditable() or startCellEditing() is a MouseEvent.
`java.awt.Component` | `getComponent()` Returns the a reference to the editor component.
`java.awt.Component` | `getTableCellEditorComponent(JTable table, java.lang.Object value, boolean isSelected, int row, int column)`
`java.awt.Component` | `getTreeCellEditorComponent(JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)`
`boolean` | `isCellEditable(java.util.EventObject anEvent)`
`void` | `removeCellEditorListener(CellEditorListener l)`
`void` | `setClickCountToStart(int count)` Specifies the number of clicks needed to start editing.
`boolean` | `shouldSelectCell(java.util.EventObject anEvent)`
`boolean` | `stopCellEditing()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### listenerList

    protected EventListenerList listenerList

  Event listeners

### changeEvent

    protected transient ChangeEvent changeEvent

### editorComponent

    protected JComponent editorComponent

### delegate

    protected DefaultCellEditor.EditorDelegate delegate

### clickCountToStart

    protected int clickCountToStart

Constructor Detail

### DefaultCellEditor

    public DefaultCellEditor(JTextField x)

  Constructs a DefaultCellEditor that uses a text field.
  Parameters:
    `x` - a JTextField object ...

### DefaultCellEditor

    public DefaultCellEditor(JCheckBox x)

  Constructs a DefaultCellEditor object that uses a check box.
  Parameters:
    `x` - a JCheckBox object ...

### DefaultCellEditor

    public DefaultCellEditor(JComboBox x)

  Constructs a DefaultCellEditor object that uses a combo box.
  Parameters:
    `x` - a JComboBox object ...

Method Detail

### getComponent

    public java.awt.Component getComponent()

  Returns the a reference to the editor component.
  Returns:
    the editor Component

### setClickCountToStart

    public void setClickCountToStart(int count)

  Specifies the number of clicks needed to start editing.
  Parameters:
    `count` - an int specifying the number of clicks needed to start editing
  See Also:
    `getClickCountToStart()`

### getClickCountToStart

    public int getClickCountToStart()

  clickCountToStart controls the number of clicks required to start editing if the event passed to isCellEditable() or startCellEditing() is a MouseEvent. For example, by default the clickCountToStart for a JTextField is set to 2, so in a JTable the user will need to double click to begin editing a cell.

### getCellEditorValue

    public java.lang.Object getCellEditorValue()

### isCellEditable

    public boolean isCellEditable(java.util.EventObject anEvent)

### shouldSelectCell

    public boolean shouldSelectCell(java.util.EventObject anEvent)

### stopCellEditing

    public boolean stopCellEditing()

### cancelCellEditing

    public void cancelCellEditing()

### addCellEditorListener

    public void addCellEditorListener(CellEditorListener l)

### removeCellEditorListener

    public void removeCellEditorListener(CellEditorListener l)

### fireEditingStopped

    protected void fireEditingStopped()

### fireEditingCanceled

    protected void fireEditingCanceled()

### getTreeCellEditorComponent

    public java.awt.Component getTreeCellEditorComponent(JTree tree,
                                                         java.lang.Object value,
                                                         boolean isSelected,
                                                         boolean expanded,
                                                         boolean leaf,
                                                         int row)

  Specified by:
    getTreeCellEditorComponent in interface TreeCellEditor

### getTableCellEditorComponent

    public java.awt.Component getTableCellEditorComponent(JTable table,
                                                          java.lang.Object value,
                                                          boolean isSelected,
                                                          int row,
                                                          int column)

  Specified by:
    getTableCellEditorComponent in interface TableCellEditor

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.