Package javax.swing

Examples of javax.swing.JFrame.pack()


  public void windowClosing(WindowEvent e) {
    jf.dispose();
    System.exit(0);
  }
      });
      jf.pack();
      jf.setSize(800, 600);
      jf.setVisible(true);
    } catch (Exception ex) {
      ex.printStackTrace();
      System.err.println(ex.getMessage());
View Full Code Here


        }
      };
    furnitureFrame.setIconImage(new ImageIcon(
        FurnitureLibraryEditor.class.getResource("resources/frameIcon.png")).getImage());
    furnitureFrame.setLocationByPlatform(true);
    furnitureFrame.pack();
    furnitureFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    furnitureFrame.setVisible(true);
    furnitureFrame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent ev) {
View Full Code Here

  {
    JFrame mainAppWindow = new JFrame();
    JPanel panel = new JPanel();
    panel.add(new JLabel("foobar"));
    mainAppWindow.add(panel);
    mainAppWindow.pack();
    mainAppWindow.setVisible(true);
    try
    {
      Thread.sleep(1000);
    }
View Full Code Here

                    System.exit(0);
                }
            });
        }

        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        if (args.length == 0) {
View Full Code Here

                public void windowClosed(WindowEvent e) {
                    System.exit(0);
                }
            });
            frame.getContentPane().add(new JLabel(new ImageIcon(bi)));
            frame.pack();
            frame.setVisible(true);

        } catch (TranscoderException e2) {
            e2.printStackTrace();
        } catch (MalformedURLException e) {
View Full Code Here

        JFrame paletteWindow = new JFrame(windowName);

        paletteWindow.addComponentListener(cl);
        paletteWindow.getContentPane().add(scrollPane);
        //layout all the components
        paletteWindow.pack();
        return paletteWindow;
    }

    /**
     * Get a layer's associated palette as a top-level window
View Full Code Here

        pane.setAlignmentY(Component.BOTTOM_ALIGNMENT);
        pane.add(gui);
        JFrame paletteWindow = new JFrame(windowName);
        paletteWindow.addComponentListener(cl);
        paletteWindow.getContentPane().add(pane);
        paletteWindow.pack();

        return paletteWindow;
    }
}
View Full Code Here

    public void setKey(String aKey) {}

    public static void main(String[] argv) {
        JFrame frame = new JFrame("IconFactoryTestingTool");
        frame.getContentPane().add(new IconFactoryTestingTool().getFace());
        frame.pack();
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                // need a shutdown event to notify other gui beans and
                // then exit.
                System.exit(0);
View Full Code Here

                switch (obj.rt) {
                case OMGraphic.RENDERTYPE_LATLON:
                    jframe.setTitle(title + " - LatLon");
                    main.getContentPane().removeAll();
                    main.getContentPane().add(obj.getGUI());
                    jframe.pack();
                    jframe.setVisible(true);
                    break;
                case OMGraphic.RENDERTYPE_XY:
                    jframe.setTitle(title + " - XY");
                    main.getContentPane().removeAll();
View Full Code Here

                    break;
                case OMGraphic.RENDERTYPE_XY:
                    jframe.setTitle(title + " - XY");
                    main.getContentPane().removeAll();
                    main.getContentPane().add(obj.getGUI());
                    jframe.pack();
                    jframe.setVisible(true);
                    break;
                case OMGraphic.RENDERTYPE_OFFSET:
                    jframe.setTitle(title + " - XY Offset");
                    main.getContentPane().removeAll();
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.