Example usage for java.awt Frame setLayout

List of usage examples for java.awt Frame setLayout

Introduction

In this page you can find the example usage for java.awt Frame setLayout.

Prototype

public void setLayout(LayoutManager mgr) 

Source Link

Document

Sets the layout manager for this container.

Usage

From source file:pl.edu.icm.visnow.lib.utils.ImageUtilities.java

public static Frame getNonClearingFrame(String name, Component c) {
    final Frame f = new Frame(name) {

        @Override//w w w  .  j av  a  2s  .  c om
        public void update(Graphics g) {
            paint(g);
        }
    };
    sizeContainerToComponent(f, c);
    centerFrame(f);
    f.setLayout(new BorderLayout());
    f.add(c, BorderLayout.CENTER);
    f.addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent e) {
            f.dispose();
        }
    });
    return f;
}