Package java.awt

Examples of java.awt.Frame.pack()


        }
    }

    public static void main(String[] args) {
        Frame f = new Frame();
        f.pack();
        GraphicsConfiguration gc = f.getGraphicsConfiguration();
        if (gc.getColorModel().getPixelSize() < 16) {
            System.out.printf("Bit depth: %d . Test considered passed.",
                              gc.getColorModel().getPixelSize());
            f.dispose();
View Full Code Here


        }

        DrawImageBilinear test = new DrawImageBilinear();
        Frame frame = new Frame();
        frame.add(test);
        frame.pack();
        frame.setVisible(true);

        // Wait until the component's been painted
        synchronized (test) {
            while (!done) {
View Full Code Here

        for (int i = 0; i < frames.length; i++) {
            GraphicsConfiguration gc = gd[i].getDefaultConfiguration();
            Frame f = new Frame("Frame on "+gc, gc);
            f.setSize(100, 100);
            f.setLocation(gc.getBounds().x, gc.getBounds().y);
            f.pack();
            frames[i] = f;
        }

        Font f1 = new Font("Dialog", Font.PLAIN, 10);
        Font f2 = new Font("Dialog", Font.ITALIC, 12);
View Full Code Here

        final Frame frame = new Frame("OnScreenRenderingResizeTest") {
            public void paint(Graphics g) {}
            public void update(Graphics g) {}
        };
        frame.setBackground(bgColor);
        frame.pack();
        frame.setSize(FRAME_W, FRAME_H);
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                done = true;
            }
View Full Code Here

                    System.exit(0);
                }
            });

            window.add(canvas);
            window.pack();
            canvas.requestFocusInWindow();
            window.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
            window.setTitle(WINDOW_TITLE);
            window.setVisible(true);
            this.window = window;
View Full Code Here

            final java.awt.Frame frame = new Frame("Openoffice.org");
            bean.setOOoCallTimeOut(10000);

            try {
                frame.add(bean, BorderLayout.CENTER);
                frame.pack();
                frame.setSize(600,400);
                frame.show();
                bean.loadFromURL("private:factory/swriter", null);
                frame.validate();
                // #1
View Full Code Here

            c.gridx = 1;
            c.gridy = 1;
            c.insets = new Insets(10, 0, 0, 0);
            f.add(bp4, c);

            f.pack();
            f.setBounds(0, 0, 1000, 600);
            f.setVisible(true);
            try {
            bean1.loadFromURL("private:factory/swriter", null);
            bean2.loadFromURL("private:factory/swriter", null);
View Full Code Here

            final java.awt.Frame frame = new Frame("Openoffice.org");
            bean.setOOoCallTimeOut(10000);

            try {
                frame.add(bean, BorderLayout.CENTER);
                frame.pack();
                frame.setSize(600,400);
                frame.show();
                bean.loadFromURL("private:factory/swriter", null);
                frame.validate();
                // #1
View Full Code Here

            c.gridx = 1;
            c.gridy = 1;
            c.insets = new Insets(10, 0, 0, 0);
            f.add(bp4, c);

            f.pack();
            f.setBounds(0, 0, 1000, 600);
            f.setVisible(true);
            try {
            bean1.loadFromURL("private:factory/swriter", null);
            bean2.loadFromURL("private:factory/swriter", null);
View Full Code Here

   
   
    Frame frame = new JFrame("9GAG");
    JLabel label = new JLabel(new ImageIcon(image));
    ((JFrame) frame).getContentPane().add(label, BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);
  }

}
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.