Package java.awt

Examples of java.awt.Frame.addWindowListener()


                final Frame f = new Frame("System Configuration Error");
                f.add(new Label("Java version 1.4 or later is required to run this program."), BorderLayout.NORTH);
                f.add(new Label("Please download it from http://java.sun.com/"), BorderLayout.SOUTH);
                f.pack();
                f.setVisible(true);
                f.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        synchronized (f) {
                            f.notifyAll();
                        }
                    }
View Full Code Here


        cbuf[0] = (char) ch;
        mp.append(new String(cbuf));
        ch = st.read();
      }
      final Frame top  = new Frame("Show URL");
      top.addWindowListener(
        new WindowAdapter() {

          public void windowClosing(WindowEvent windowEvent) {
            top.dispose();
          }
View Full Code Here

  public void urlAccessViolation(String url) {
    TextArea mp      = new TextArea("Bad URL\n" +
        "There was a security exception accessing the url\n" + url +
        "\nremember, applets can only load urls from the same server");
    final Frame top  = new Frame("Bad URL");
    top.addWindowListener(
      new WindowAdapter() {

        public void windowClosing(WindowEvent windowEvent) {
          top.dispose();
        }
View Full Code Here

        cbuf[0] = (char) ch;
        mp.append(new String(cbuf));
        ch = st.read();
      }
      final Frame top  = new Frame("Show URL");
      top.addWindowListener(
        new WindowAdapter() {

          public void windowClosing(WindowEvent windowEvent) {
            top.dispose();
          }
View Full Code Here

    table.setCellRenderer(Image.class, new TestImageTableCellRenderer());
    frame.setLayout(new BorderLayout());
    frame.add(table, BorderLayout.CENTER);
    frame.setSize(new Dimension(800, 600));
    UIUtil.positionComponent(UIUtil.CENTER, frame);
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent evt) {
        System.exit(0);
      }
    });
    frame.setVisible(true);
View Full Code Here

    tabs.setSelectedTab(1);

    frame.add(tabs, BorderLayout.CENTER);
    frame.pack();
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent evt) {
        System.exit(0);
      }

    });
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

    public static void main(String[] args) throws Exception {
        Frame f = new Frame("Test Player");
        f.setIconImage(new ImageIcon(VolumeTestPlayer.class.getResource("/icons/vlcj-logo.png")).getImage());
        f.setSize(800, 600);
        f.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
View Full Code Here

    public OverlayTest(String mrl) {
        Frame f = new Frame("Test Player");
        f.setIconImage(new ImageIcon(getClass().getResource("/icons/vlcj-logo.png")).getImage());
        f.setSize(800, 600);
        f.setBackground(Color.black);
        f.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
View Full Code Here

                if (popup.getItemCount() > 0)
                    popup.remove(0);
            }
        });
        f.add(removeItem, BorderLayout.SOUTH);
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent event) {
                f.dispose();
            }
        });
        f.setSize(300, 300);
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.