Package java.awt.event

Examples of java.awt.event.WindowStateListener


    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                LoginOptionsFrame lfe = new LoginOptionsFrame();
                lfe.addWindowStateListener(new WindowStateListener() {

                    public void windowStateChanged(WindowEvent evt) {
                        if (evt.getNewState() == WindowEvent.WINDOW_CLOSED) {
                            System.exit(0);
                        }
View Full Code Here


    b.add(tabs);
    getContentPane().add(b);
    setSize(800, 500);

    // Make sure the window gets laid out when maximized/restored
        addWindowStateListener(new WindowStateListener() {
      @Override
      public void windowStateChanged(WindowEvent e) {
        if(e.getID() == WindowEvent.WINDOW_STATE_CHANGED)
          ((Window)e.getSource()).validate();
      }});
View Full Code Here

      SystemTray.getSystemTray().add(tray);
    } catch(AWTException e) {
      Out.exception(e);
    }

    addWindowStateListener(new WindowStateListener() {
      @Override
      public void windowStateChanged(WindowEvent e) {
        if(GlobalSettings.trayMinimizeTo && ((e.getNewState() & Frame.ICONIFIED) != 0)) {
          setVisible(false);
          setState(e.getNewState() & ~Frame.ICONIFIED);
View Full Code Here

      Container c= gcw.getTopLevelAncestor();
      if(c instanceof Window)
      {
        if(windowStateListener==null)
        {
          windowStateListener= new WindowStateListener()
          {
            public void windowStateChanged(WindowEvent e)
            {
              if((e.getNewState() & Frame.ICONIFIED) != 0)
              {
View Full Code Here

        frame.setTitle("Tree With Archiving CDMA plugin");
        frame.setContentPane(tabbedPane);
        frame.setSize(500, 500);
        frame.setTitle(tabbedPane.getClass().getName());
        ((Frame) frame).addWindowStateListener(new WindowStateListener() {
            @Override
            public void windowStateChanged(WindowEvent event) {
                if (event.getNewState() == WindowEvent.WINDOW_CLOSED) {
                    tablePanelOpen = false;
                }
View Full Code Here

    });
   
    progressDialog = new ProgressDialog(this, "Importing file...");
    progressDialog.setButtonText("Cancel");
   
    progressDialog.addWindowStateListener(new WindowStateListener() {
     
      @Override
      public void windowStateChanged(WindowEvent e) {
        if(e.equals(WindowEvent.WINDOW_CLOSED)) {
          onImportCanceled();
View Full Code Here

        //gd.addSlider(new WeightedEdgeGraphFilter())
        JFrame jf = new JFrame();
        jf.getContentPane().add(gd);
        jf.pack();
        jf.show();
        jf.addWindowStateListener(new WindowStateListener() {

          public void windowStateChanged(WindowEvent e) {
            if (e.getID() == WindowEvent.WINDOW_CLOSING) {
              stop = true;
              gd.stop();
View Full Code Here

        }
    }

    protected void processWindowStateEvent(WindowEvent e) {
        for (Iterator<?> i = windowStateListeners.getUserIterator(); i.hasNext();) {
            WindowStateListener listener = (WindowStateListener) i.next();
            switch (e.getID()) {
                case WindowEvent.WINDOW_STATE_CHANGED:
                    listener.windowStateChanged(e);
                    break;
            }
        }
    }
View Full Code Here

        }
    }

    protected void processWindowStateEvent(WindowEvent e) {
        for (Iterator<?> i = windowStateListeners.getUserIterator(); i.hasNext();) {
            WindowStateListener listener = (WindowStateListener) i.next();
            switch (e.getID()) {
                case WindowEvent.WINDOW_STATE_CHANGED:
                    listener.windowStateChanged(e);
                    break;
            }
        }
    }
View Full Code Here

            trayIcon.setImageAutoSize(true);
        } else {
            System.out.println("system tray not supported");
        }
        final String os = System.getProperty("os.name").toLowerCase();
        addWindowStateListener(new WindowStateListener() {

            @Override
            public void windowStateChanged(WindowEvent e) {
                System.out.println("-----:" + e.getNewState());
                if (e.getNewState() == ICONIFIED) {
View Full Code Here

TOP

Related Classes of java.awt.event.WindowStateListener

Copyright © 2018 www.massapicom. 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.