public class DefaultCellEditor extends AbstractCellEditor implements TableCellEditor, TreeCellEditor
 警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans包中。 请参阅XMLEncoder 。 
| Modifier and Type | Class and Description | 
|---|---|
| protected class  | DefaultCellEditor.EditorDelegate
              受保护的 
              EditorDelegate类。 | 
| Modifier and Type | Field and Description | 
|---|---|
| protected int | clickCountToStart
              一个整数,指定开始编辑所需的点击次数。 
             | 
| protected DefaultCellEditor.EditorDelegate | delegate
              处理从 
              CellEditor发送的所有方法的代理类。 | 
| protected JComponent | editorComponent
              正在编辑的Swing组件。 
             | 
changeEvent, listenerList| Constructor and Description | 
|---|
| DefaultCellEditor(JCheckBox checkBox)
              构造一个使用复选框的 
              DefaultCellEditor对象。 | 
| DefaultCellEditor(JComboBox comboBox)
              构造一个使用组合框的 
              DefaultCellEditor对象。 | 
| DefaultCellEditor(JTextField textField)
              构造一个使用文本字段的 
              DefaultCellEditor。 | 
| Modifier and Type | Method and Description | 
|---|---|
| void | cancelCellEditing()
              将消息从 
              CellEditor到delegate。 | 
| Object | getCellEditorValue()
              转发消息从 
              CellEditor到delegate。 | 
| int | getClickCountToStart()
              返回开始编辑所需的点击次数。 
             | 
| Component | getComponent()
              返回对编辑器组件的引用。 
             | 
| Component | getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
              实现 
              TableCellEditor界面。 | 
| Component | getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
              实现 
              TreeCellEditor接口。 | 
| boolean | isCellEditable(EventObject anEvent)
              转发消息从 
              CellEditor到delegate。 | 
| void | setClickCountToStart(int count)
              指定开始编辑所需的点击次数。 
             | 
| boolean | shouldSelectCell(EventObject anEvent)
              将消息从 
              CellEditor到delegate。 | 
| boolean | stopCellEditing()
              将消息从 
              CellEditor到delegate。 | 
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCellEditorListener, removeCellEditorListenerprotected JComponent editorComponent
protected DefaultCellEditor.EditorDelegate delegate
CellEditor发送的所有方法的代理类。 
          protected int clickCountToStart
clickCountToStart被定义为零,它将不会启动,直到发生点击。 
          @ConstructorProperties(value="component") public DefaultCellEditor(JTextField textField)
DefaultCellEditor 。 
          textField - 一个 
            JTextField对象 
           public DefaultCellEditor(JCheckBox checkBox)
DefaultCellEditor对象。 
          checkBox - 一个 
            JCheckBox对象 
           public DefaultCellEditor(JComboBox comboBox)
DefaultCellEditor对象。 
          comboBox - 一个 
            JComboBox对象 
           public Component getComponent()
Component 
           public void setClickCountToStart(int count)
count - 一个int指定开始编辑所需的点击次数 
           getClickCountToStart() 
           public int getClickCountToStart()
public Object getCellEditorValue()
CellEditor到 
           delegate 。 
          getCellEditorValue在接口 
            CellEditor 
           DefaultCellEditor.EditorDelegate.getCellEditorValue() 
           public boolean isCellEditable(EventObject anEvent)
CellEditor到 
           delegate 。 
          isCellEditable在界面 
            CellEditor 
           isCellEditable在 
            AbstractCellEditor 
           anEvent - 事件对象 
           DefaultCellEditor.EditorDelegate.isCellEditable(EventObject) 
           public boolean shouldSelectCell(EventObject anEvent)
CellEditor到 
           delegate 。 
          shouldSelectCell在界面 
            CellEditor 
           shouldSelectCell在 
            AbstractCellEditor 
           anEvent - 事件对象 
           DefaultCellEditor.EditorDelegate.shouldSelectCell(EventObject) 
           public boolean stopCellEditing()
CellEditor到 
           delegate 。 
          stopCellEditing中的 
            CellEditor 
           stopCellEditing在 
            AbstractCellEditor 
           DefaultCellEditor.EditorDelegate.stopCellEditing() 
           public void cancelCellEditing()
CellEditor到 
           delegate 。 
          cancelCellEditing在界面 
            CellEditor 
           cancelCellEditing在 
            AbstractCellEditor 
           DefaultCellEditor.EditorDelegate.cancelCellEditing() 
           public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
TreeCellEditor界面。 
          getTreeCellEditorComponent中的 
            TreeCellEditor 
           tree - 要求编辑编辑的JTree; 
            此参数可以为null 
           value - 要编辑的单元格的值 
           isSelected - 如果要使用选择突出显示单元格,则为true 
           expanded - 如果节点被扩展,则为true 
           leaf - 如果节点是叶节点,则为true 
           row - 正在编辑的节点的行索引 
           public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
TableCellEditor接口。 
          getTableCellEditorComponent在接口 
            TableCellEditor 
           table - 要求编辑编辑的JTable ; 
            可以是null 
           value - 要编辑的单元格的值; 
            由具体的编辑来解释和绘制价值。 
            例如,如果value是字符串“true”,它可以被渲染为一个字符串,或者它可以被渲染为一个被勾选的复选框。 
            null是一个有效的值 
           isSelected - 如果 
            isSelected显示单元格,则为true 
           row - 要编辑的单元格行 
           column - 正在编辑的单元格列 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.