Example usage for javax.swing.text JTextComponent setEditable

List of usage examples for javax.swing.text JTextComponent setEditable

Introduction

In this page you can find the example usage for javax.swing.text JTextComponent setEditable.

Prototype

@BeanProperty(description = "specifies if the text can be edited")
public void setEditable(boolean b) 

Source Link

Document

Sets the specified boolean to indicate whether or not this TextComponent should be editable.

Usage

From source file:Main.java

public static void setEditable(JTextComponent... components) {
    for (JTextComponent component : components) {
        component.setEditable(true);
    }// w  ww .  j av  a2 s .c om
}

From source file:Main.java

public static void setUneditable(JTextComponent... components) {
    for (JTextComponent component : components) {
        component.setEditable(false);
    }/*from  www  .  j av  a  2 s.  c om*/
}

From source file:Main.java

public static void setEditable(JTextComponent component, boolean editable) {
    component.setEditable(editable);
    component.setBackground(editable ? NORMAL_BG : NOT_EDITABLE_BG);
}

From source file:com.haulmont.cuba.desktop.gui.components.DesktopPickerField.java

@Override
protected void setEditableToComponent(boolean editable) {
    for (Action action : actionsOrder) {
        if (action instanceof StandardAction) {
            ((StandardAction) action).setEditable(editable);
        }//ww w. j a  va 2s  .  c o  m
    }
    if (!editable && impl.getEditor() instanceof JTextComponent) {
        JTextComponent editor = (JTextComponent) impl.getEditor();
        editor.setEditable(false);
    }
    updateMissingValueState();
}