Example usage for javax.swing JInternalFrame requestFocus

List of usage examples for javax.swing JInternalFrame requestFocus

Introduction

In this page you can find the example usage for javax.swing JInternalFrame requestFocus.

Prototype

public void requestFocus() 

Source Link

Document

Requests that this Component gets the input focus.

Usage

From source file:GUIUtils.java

public static void moveToFront(final JInternalFrame fr) {
    if (fr != null) {
        processOnSwingEventThread(new Runnable() {
            public void run() {
                fr.moveToFront();/*from w w  w.  j  av  a2 s . co  m*/
                fr.setVisible(true);
                try {
                    fr.setSelected(true);
                    if (fr.isIcon()) {
                        fr.setIcon(false);
                    }
                    fr.setSelected(true);
                } catch (PropertyVetoException ex) {

                }
                fr.requestFocus();
            }
        });
    }

}