Package java.awt

Examples of java.awt.Frame.pack()


                MultiDeviceFractal.this.release(e.getWindow());
            }
        });
        canvas.setPreferredSize(new Dimension(width, height));
        frame.add(canvas);
        frame.pack();

        frame.setVisible(true);

        textRenderer = new TextRenderer(frame.getFont().deriveFont(Font.BOLD, 14), true, true, null, false);
    }
View Full Code Here


                                                                new WindowAdapter () {
                                                                    public void windowClosing (WindowEvent e) {
                                                                        System.exit (0);
                                                                    }
                                                                });
                                            f.pack ();
                                            f.show ();
          } else {
                                            System.err.println("Result: " +
                                                               obj);
          }
View Full Code Here

        Frame frame = new Frame("Minecraft");
        Canvas canvas = new Canvas();
        frame.setLayout(new BorderLayout());
        frame.add(canvas, "Center");
        canvas.setPreferredSize(new Dimension(854, 480));
        frame.pack();
        frame.setLocationRelativeTo(null);
        MinecraftImpl minecraftimpl = new MinecraftImpl(frame, canvas, null, 854, 480, flag, frame);
        Thread thread = new Thread(minecraftimpl, "Minecraft main thread");
        thread.setPriority(10);
        minecraftimpl.minecraftUri = "www.minecraft.net";
View Full Code Here

                    }

                };

                frame.add(p);
                frame.pack();
                frame.setVisible(true);

                Thread.sleep(timeOut);
                frame.dispose();
            } catch (HeadlessException exception) {
View Full Code Here

                   
                   
                };

                frame.add(p);
                frame.pack();
                frame.setVisible(true);

                Thread.sleep(timeOut);
                frame.dispose();
            } catch (HeadlessException exception) {
View Full Code Here

        frame.setLayout(new FlowLayout());
        final Button btn1 = new Button("button 1");
        frame.add(btn1);
        frame.add(new Button("button 2"));
        frame.add(new Button("button 3"));
        frame.pack();
        frame.setVisible(true);

        Robot r = Util.createRobot();
        Util.waitForIdle(r);
        Util.clickOnComp(btn1, r);
View Full Code Here

public class FrameMinimizeTest {
    public static void main(String args[]) throws Exception {
        Frame frame = new Frame("Frame Minimize Test");
        Button b = new Button("Focus ownder");
        frame.add("South", b);
        frame.pack();
        frame.setVisible(true);
        Util.waitForIdle(null);
        if (!b.hasFocus()) {
            throw new RuntimeException("button is not a focus owner after showing :(");
        }
View Full Code Here

            return;
        }

        try {
            final Frame frame = new Frame("AWT Frame");
            frame.pack();
            frame.setSize(200,200);

            final Frame embedded_frame = Util.createEmbeddedFrame(frame);
            embedded_frame.setSize(200, 200);
            Sysout.println("embedded_frame = " + embedded_frame);
View Full Code Here

        Util.waitForIdle(robot);

        Frame another_frame = new Frame("Another frame");
        Button btn2 = new Button("button in a frame");
        another_frame.add(btn2);
        another_frame.pack();
        another_frame.setLocation(300, 0);
        another_frame.setVisible(true);
        Util.waitForIdle(robot);

        Util.clickOnTitle(owner_frame, robot);
View Full Code Here

   
    public void testLoadJAWT() {
        if (GraphicsEnvironment.isHeadless()) return;

        Frame f = new Frame(getName());
        f.pack();
        try {
            // FIXME: this works as a test, but fails in ShapedWindowDemo
            // if the JAWT load workaround is not used
            Native.getWindowPointer(f);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.