Source Code : Gets the root pane of the window.

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Gets the root pane of the window.

  
//package com.javadocking.util;

import java.awt.Window;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JRootPane;
import javax.swing.JWindow;


/**
 * This class contains a collection of static utility methods for Swing.
 * 
 * @author Heidi Rakels.
 */
public class SwingUtil
{
  /**
   * Gets the root pane of the window.
   * The window should be a javax.swing.JFrame, javax.swing.JDialog
   * or javax.swing.JWindow. Otherwise null is returned.
   * 
   * @param   window      The window whose root pane is retrieved.
   * @return           The root pane of the window of the component.
   */
  public static JRootPane getRootPane(Window window)
  {
    
    if (window == null)
    {
      return null;
    }
    
    // Get the root pane if we can find one.
    if (window instanceof JFrame)
      return ((JFrame)window).getRootPane();
    if (window instanceof JWindow)
      return ((JWindow)window).getRootPane();
    if (window instanceof JDialog)
      return ((JDialog)window).getRootPane();

    // We could not find a root pane for this window.
    return null;  
    
  }
}

   
    
  

Thank with us