Java JTable Cell Editor setEditable(JSpinner spinner, boolean bool)

Here you can find the source of setEditable(JSpinner spinner, boolean bool)

Description

Make the spinner text field editable, or not

License

Open Source License

Parameter

Parameter Description
spinner the spinner to update
bool true if editable, false otherwise

Declaration

public static void setEditable(JSpinner spinner, boolean bool) 

Method Source Code

//package com.java2s;
//  This software is released under the GNU General Public License.           //

import javax.swing.*;

public class Main {
    /**//  ww w  .j  a  va2  s .  c o m
     * Make the spinner text field editable, or not
     *
     * @param spinner the spinner to update
     * @param bool true if editable, false otherwise
     */
    public static void setEditable(JSpinner spinner, boolean bool) {
        JSpinner.DefaultEditor editor;
        editor = (JSpinner.DefaultEditor) spinner.getEditor();
        editor.getTextField().setEditable(bool);
    }
}

Related

  1. setCellEditor(JTable table, int columnIdx, TableCellEditor editor)
  2. setCharacterAttributes(final AttributeSet attr, final boolean replace, final JEditorPane editorPane, final StyledDocument doc, final MutableAttributeSet inputAttrs)
  3. setClickCountToStartEditing(JTable table, int count)
  4. setClickCountToStartEditing(JTable table, int count)
  5. setDefaultTableEditorsClicks(JTable table, int clickCountToStart)
  6. setEditable(JTextComponent component, boolean editable)
  7. setEditable(JTextComponent... components)
  8. setEditableFalse(JTextField field)
  9. setUneditable(JTextComponent... components)