Example usage for javax.swing JInternalFrame setLayer

List of usage examples for javax.swing JInternalFrame setLayer

Introduction

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

Prototype

@BeanProperty(bound = false, expert = true, description = "Specifies what desktop layer is used.")
public void setLayer(int layer) 

Source Link

Document

Convenience method for setting the layer attribute of this component.

Usage

From source file:org.pentaho.reporting.engine.classic.demo.ancient.demo.layouts.internalframe.InternalFrameDemoFrame.java

/**
 * Handler method called by the preview action. This method should perform all operations to preview the report.
 *//*w  w  w .j av a 2 s. c  o m*/
protected void attemptPreview() {
    final JInternalFrame frame = findSelectedFrame();
    if (frame == null) {
        return;
    }
    final Rectangle bounds = frame.getBounds();
    final Container parent = frame.getParent();
    final boolean visible = frame.isVisible();
    final int layer = frame.getLayer();

    // now print ..
    previewReport(frame);

    if (parent != null) {
        if (frame.getParent() != parent) {
            frame.getParent().remove(frame);
            parent.add(frame);
        }
    }
    frame.setBounds(bounds);
    frame.setVisible(visible);
    frame.setLayer(new Integer(layer));
}