Example usage for javax.swing.text JTextComponent setFocusable

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

Introduction

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

Prototype

public void setFocusable(boolean focusable) 

Source Link

Document

Sets the focusable state of this Component to the specified value.

Usage

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

@Override
public void updateEnabled() {
    super.updateEnabled();

    boolean resultEnabled = isEnabledWithParent();
    for (DesktopButton button : buttons) {
        button.setParentEnabled(resultEnabled);
    }// ww w. java  2  s  .c  o  m

    if (impl.getEditor() instanceof JTextComponent) {
        JTextComponent editor = (JTextComponent) impl.getEditor();
        editor.setFocusable(resultEnabled);
    }
}