Package java.awt

Examples of java.awt.Frame.pack()


            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


    }
   
    private static class AWT {
        public static void loadJAWT(String name) {
            Frame f = new Frame(name);
            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

    }
   
    private static class AWT {
        public static void loadJAWT(String name) {
            Frame f = new Frame(name);
            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

                public void windowClosing(WindowEvent event) {
                    frame.dispose();
                }
            });
            //frame.getContentPane().add(new GlyphPanel(maxCharBounds));
            frame.pack();
            frame.setSize(500, 500);
            frame.add(new Component() {
                public void paint(Graphics g) {
                    System.out.println("Paint");
                    g.setColor(Color.RED);
View Full Code Here

    else
      {
        f = new Frame();
        f.add(c);
      }
    f.pack();
    f.setVisible(true);

    // Print instructions and expected results on console.
    System.out.println("====================================================");
    System.out.print("This is a test that needs human interaction. Please ");
View Full Code Here

    Canvas c = new Canvas();
    c.setBackground(Color.blue);
    c.setSize(100,100);
    add(c);
    f.add(this);
    f.pack();
    f.show();
    Point loc = f.getLocationOnScreen();
    Rectangle bounds = c.getBounds();
    Insets i = f.getInsets();
    bounds.x += i.left + loc.x;
View Full Code Here

    MenuBar mb = new MenuBar();
    Menu m = new Menu("Menu 1");
    mb.add(m);
    f.setMenuBar(mb);
    f.add(new Button("Button"));
    f.pack();
    MenuItem itemA = new MenuItem("Item A");
    m.insert(itemA, 0);
    MenuItem itemB = new MenuItem("Item B");
    m.insert(itemB, 0);
    MenuItem itemC = new MenuItem("Item C");
View Full Code Here

   
    a.add(c);
    a.add(l);
    c.setSize(100,100);
    f.add(a);
    f.pack();
    f.show();   
    harness.check(a.isShowing(), true);
    harness.check(c.isShowing(), true);
    harness.check(l.isShowing(), true);
    harness.check(f.isShowing(), true);
View Full Code Here

    Frame f = new Frame();
    Label c = new Label("label");
    c.setBackground(Color.blue);
    add(c);
    f.add(this);
    f.pack();
    f.show();
    Point loc = f.getLocationOnScreen();
    Rectangle bounds = c.getBounds();
    Insets i = f.getInsets();
    bounds.x += loc.x + i.left;
View Full Code Here

    setBackground(Color.red);
    Frame f = new Frame();
    ScrollPane c = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
    add(c);
    f.add(this);
    f.pack();
    f.show();
    Rectangle bounds = c.getBounds();
    Insets i = f.getInsets();
    Point loc = f.getLocationOnScreen();
    loc.x += i.left + bounds.x;
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.