Package java.awt

Examples of java.awt.Frame.pack()


                }
            };

            frame.add(p);
            p.setSize(width, height);
            frame.pack();
            frame.setVisible(true);

            try {
                Thread.sleep(timeOut);
            } catch (InterruptedException e) {
View Full Code Here


    public static void main(String[] args) {
        Frame frame = new PacketTool();

        // set visible on middle of screen
        Dimension screenSize = frame.getToolkit().getScreenSize();
        frame.pack();
        frame.setLocation(screenSize.width / 2 - frame.getSize().width / 2,
                screenSize.height / 2 - frame.getSize().height / 2);

        // Show the window.
        frame.setVisible(true);
View Full Code Here

        });
        panel.add(color);

        // Show the window.
        dialog.pack();
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        new TestImageButtons();
View Full Code Here

    public static void display(Image im, String title) throws Exception {
        Frame f = new WSIFFrame(im,title);
        frames[frameIndex] = f;
        frameIndex++;
        f.add(new WSIFCanvas(im));
        f.pack();
        f.setLocation(300*frameIndex,200);
        f.show();
    }

    public WSIFFrame(Image im, String title) {
View Full Code Here

        ScrollPane scroller = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
        scroller.add(canvas);
        scroller.setSize(screen.getFramebufferWidth(), screen.getFramebufferHeight());

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

        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent evt) {
                frame.setVisible(false);
View Full Code Here

                throw new InternalErrorException(e);
            }
        }

        // Show the result.
        frame.pack();
        frame.setVisible(true);
    }

    // FIXME: Check that the container is an instance of CodeGenerator.
}
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

      }
    });
    p.add(b, BorderLayout.SOUTH);

    f.add(p);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
  }

  /**
 
View Full Code Here

      }
    });
    p.add(b, BorderLayout.SOUTH);

    f.add(p);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
  }

  /**
 
View Full Code Here

          fenetre.add(inter);
          fenetre.setSize(400, 320);

      // initialisation de l'interface.
          inter.init();
    fenetre.pack();
          fenetre.show();
  }


  /**
 
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.