Re[3]: Редактирование ячеек в JTable
От: Blazkowicz Россия  
Дата: 28.07.06 10:54
Оценка: 1 (1)
Здравствуйте, эйчЪ, Вы писали:

Ъ>Да стандартно все.


Все "стандартно" наследуется от DefaultCellEditor и использхует конструктор:
    public DefaultCellEditor(final JTextField textField) {
        editorComponent = textField;
    this.clickCountToStart = 2;
        delegate = new EditorDelegate() {
            public void setValue(Object value) {
        textField.setText((value != null) ? value.toString() : "");
            }

        public Object getCellEditorValue() {
        return textField.getText();
        }
        };
    textField.addActionListener(delegate);
    }


Интересное выделено болдом.

Есть и соответствующее свойство:

    /**
     * Specifies the number of clicks needed to start editing.
     *
     * @param count  an int specifying the number of clicks needed to start editing
     * @see #getClickCountToStart
     */
    public void setClickCountToStart(int count) {
    clickCountToStart = count;
    }

    /**
     * Returns the number of clicks needed to start editing.
     * @return the number of clicks needed to start editing
     */
    public int getClickCountToStart() {
    return clickCountToStart;
    }


Пока не нашел места где символы аппендятся если редактирование начинается с ввода значения.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.