Package java.awt

Examples of java.awt.Frame.addWindowListener()


        TextArea textArea=new TextArea("Welcome Roseindia",10,20);
        frame.add(textArea);
        frame.setLayout(new FlowLayout());
        frame.setSize(250,250);
        frame.setVisible(true);
        frame.addWindowListener(new WindowAdapter(){
        public void windowClosing(WindowEvent e){
        System.exit(0);
        }
        });
        textArea.append("w t f");
View Full Code Here


                        if (iconImage != null)
                            frame.setIconImage(iconImage);
                    }

                    // Ensure that window always remains minimized
                    frame.addWindowListener(new ChildWindowAdapter());
                    Rectangle bounds = frame.getGraphicsConfiguration().getBounds();
                    int width = (int)frame.getBounds().getWidth();
                    int height = frame.getInsets().top + frame.getInsets().bottom;
                    int x = (int)bounds.getWidth() - width;
                    int y = (int)bounds.getHeight() - height;
View Full Code Here

    f.setMenuBar(menu);
    f.add(newbrowser);
    f.add(editor);
    f.setSize(new Dimension(850,600));
    WindowCloser.windows++;
    f.addWindowListener(new WindowCloser(f));
      } catch (Exception ex) {
    ex.printStackTrace();
     
  } else  if(command.equals("close")) {
      Frame cont = (Frame)getParent();
View Full Code Here

          f.setLayout(g);
          f.setMenuBar(menu);
          f.add(browser);
          f.add(editor);       
          f.setSize(new Dimension(850,600));
        f.addWindowListener(new WindowCloser(f));
          f.show();

      } catch (java.net.MalformedURLException ex) {
        sb = new ServerBrowser(f,tl);
        sb.setVerticalScrollbar(sv);
View Full Code Here

    }
    if (frameSize.width > screenSize.width) {
      frameSize.width = screenSize.width;
    }
    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          System.exit(0);
        }
      });
    frame.setVisible(true);
View Full Code Here

    }
    if (frameSize.width > screenSize.width) {
      frameSize.width = screenSize.width;
    }
    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          System.exit(0);
        }
      });
    frame.setVisible(true);
View Full Code Here

                        } else {
                            f = new Frame ("BSF Result: " + inFileName);
                            f.add ((java.awt.Component) obj);
                        }
                        // Add a window listener to quit on closing.
                        f.addWindowListener(
                                new WindowAdapter () {
                                    public void windowClosing (WindowEvent e) {
                                        System.exit (0);
                                    }
                                }
View Full Code Here

                fOut.close();
                System.exit(0);
            }
        };
       
        f.addWindowListener(closer);
        fTextFrame.addWindowListener(closer);
       
        f.setSize(200, 80);
        f.show();
    }
View Full Code Here

      System.out.println("main");
      Frame f = new Frame("Login");
      f.setSize(300, 200);
 
      // EvenHandler클래스의 객체를 생성해서 Frame의 WindowListener로 등록한다.
      f.addWindowListener(new EventHandler());
      f.setVisible(true);
    }
  }
 
  class EventHandler implements WindowListener
View Full Code Here

        final int applicationWidth,
        final int applicationHeight )
    {
        final Frame frame = new Frame(title);
        frame.setSize( applicationWidth, applicationHeight );
        frame.addWindowListener( new WindowAdapter()
            {
                /**
                 * Handle request to shutdown.
                 * @param e event giving details of closing.
                 */
 
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.