Example usage for java.awt Frame setSize

List of usage examples for java.awt Frame setSize

Introduction

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

Prototype

public void setSize(Dimension d) 

Source Link

Document

The d.width and d.height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

Usage

From source file:ShapeMover.java

public static void main(String s[]) {
    Frame f = new Frame("ShapeMover");
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);//from  w  w  w. j a va  2s  . c o  m
        }
    });
    Applet applet = new ShapeMover();
    f.add("Center", applet);
    applet.init();
    f.pack();
    f.setSize(new Dimension(550, 250));
    f.show();
}

From source file:CustomAlphaTest.java

protected void addCanvas3D(Canvas3D c3d) {
    Frame frame = new Frame("Custom Alpha Test");

    Panel aPanel = new Panel();
    aPanel.setLayout(new BorderLayout());
    aPanel.add(c3d, BorderLayout.CENTER);

    frame.add(aPanel);//from w  w  w.j  a va2s. c om

    frame.pack();
    frame.setSize(new Dimension(320, 320));
    frame.validate();
    frame.setVisible(true);

    doLayout();
}

From source file:LightTest.java

protected void createLight(LightObject light, BranchGroup objRoot) {
    Frame frame = new Frame(light.getName());
    Panel aPanel = new Panel();
    frame.add(aPanel);//from w ww .  ja  v a2  s .  c  o m
    light.addUiToPanel(aPanel);
    frame.pack();
    frame.setSize(new Dimension(400, 250));
    frame.validate();
    frame.setVisible(true);

    // add the geometry that depicts the light
    // to the scenegraph
    objRoot.addChild(light.createGeometry());

    // finally add the light itself to the scenegraph
    objRoot.addChild(light.getLight());
}

From source file:SplineInterpolatorTest.java

public UiAlpha(Alpha alpha) {
    m_Alpha = alpha;/*from   ww  w .  jav a  2  s  .c  o m*/

    Frame frame = new Frame("Alpha Control Panel");
    JPanel panel = new JPanel();
    frame.add(panel);
    addUiToPanel(panel);
    frame.pack();
    frame.setSize(new Dimension(400, 80));
    frame.validate();
    frame.setVisible(true);
}