Package java.awt

Examples of java.awt.Frame.addWindowListener()


        //Rectangle maxCharBounds  = ((TTFHeadTable)ttf.getTable(TTFFont.FontHeaderTable)).getMaxCharBounds();
        //    System.out.println(maxCharBounds);
        final Frame frame = new Frame("TTF Test");
        try {
            frame.setBackground(Color.LIGHT_GRAY);
            frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent event) {
                    frame.dispose();
                }
            });
            //frame.getContentPane().add(new GlyphPanel(maxCharBounds));
View Full Code Here


        f.add(new JScrollPane(jta), BorderLayout.CENTER);

        f.setSize(300, 300);
        f.setLocation(0, 0);
        f.validate();
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                f.dispose();
            }
        });
        f.setVisible(true);
View Full Code Here

        BoxWorld bw = new BoxWorld();
        bw.init();
        Frame frame = new JFrame("BoxWorld");
        frame.setResizable(false);
        frame.add(bw);
        frame.addWindowListener(bw);
        frame.pack();
        frame.setSize(400, 400);
        frame.setLocation(40, 40);
        frame.setVisible(true);
        bw.requestFocus();
View Full Code Here

        shell.setSize(parent.getSize());
        shell.setLayout(new FillLayout());
        shell.layout();
       
        // Clean up the shell that was created above on dispose of the frame
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosed(WindowEvent e) {
                if (!display.isDisposed()) {
                    ThreadingHandler.getInstance().asyncExec(display, new Runnable() {
                        public void run() {
                            shell.dispose();
View Full Code Here

        if (((System.getProperty("java.awt.headless") == null) || !System.getProperty(
                "java.awt.headless").equals("true"))
                && INTERACTIVE) {
            Frame frame = new Frame(frameName);
            frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    e.getWindow().dispose();
                }
            });
View Full Code Here

        // Construct a window.
        Frame frame = new Frame("Testing Image Buttons");

        // Close the window at WM_CLOSE.
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
View Full Code Here

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

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

   * @param t
   */
  public static void lastExit(final String title, final Throwable t) {
    t.printStackTrace();
    Frame f = new Frame("Fatal error");
    f.addWindowListener(new WindowAdapter() {

      @Override
      public void windowClosing(WindowEvent arg0) {
        SystemHelper.exit(2);
      }
View Full Code Here

   * @param t
   */
  public static void lastExit(final String title, final Throwable t) {
    t.printStackTrace();
    Frame f = new Frame("Fatal error");
    f.addWindowListener(new WindowAdapter() {

      @Override
      public void windowClosing(WindowEvent arg0) {
        SystemHelper.exit(2);
      }
View Full Code Here

  public static void main(String args[])
  {
      // creation des fenetres et du monde
          Frame fenetre  = new Frame("Boids");
          Interface inter = new Interface();
    fenetre.addWindowListener(inter);

      // mise en place de l'interface
          fenetre.add(inter);
          fenetre.setSize(400, 320);
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.