Example usage for javax.swing JFrame getLayeredPane

List of usage examples for javax.swing JFrame getLayeredPane

Introduction

In this page you can find the example usage for javax.swing JFrame getLayeredPane.

Prototype

public JLayeredPane getLayeredPane() 

Source Link

Document

Returns the layeredPane object for this frame.

Usage

From source file:components.RootLayeredPaneDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread./*from   w  w w  . j a v a2 s  .  c om*/
 */
private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("RootLayeredPaneDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    RootLayeredPaneDemo newContentPane = new RootLayeredPaneDemo(frame.getLayeredPane());
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.setSize(new Dimension(300, 350));
    frame.setVisible(true);
}

From source file:SoundManagerTest.java

/**
 * Draws all Swing components//from   www.j  a  va  2 s .c  o  m
 */
public void draw(Graphics2D g) {
    JFrame frame = super.screen.getFullScreenWindow();
    frame.getLayeredPane().paintComponents(g);
}