Java JRootPane getRootPane(Window window)

Here you can find the source of getRootPane(Window window)

Description

get Root Pane

License

Apache License

Declaration

public static JRootPane getRootPane(Window window) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.Window;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JRootPane;

public class Main {

    public static JRootPane getRootPane(Window window) {
        if (window instanceof JFrame) {
            return ((JFrame) window).getRootPane();
        }//from w  ww.  j  ava 2s .  c  om

        if (window instanceof JDialog) {
            return ((JDialog) window).getRootPane();
        }

        return null;
    }
}

Related

  1. addShortcut(JRootPane rootPane, String command, Action action)
  2. closeOnEscape(final Window window, final JRootPane root)
  3. installEscapeBinding(final Window window, final JRootPane rootPane, final boolean dispose)
  4. isSecondaryWindow(JRootPane rp)
  5. makeWindowLeopardStyle(JRootPane rootPane)
  6. registerEscapeAction(JRootPane pane, ActionListener l)