Package java.awt.event

Examples of java.awt.event.WindowFocusListener


            public void componentResized(ComponentEvent e){
              setVisible(toolbar.getComponentCount() > 1 && !isVisible(toolbar.getComponent(toolbar.getComponentCount()-1), null));
            }
        });

        mainFrame.addWindowFocusListener(new WindowFocusListener() {
          public void windowGainedFocus(WindowEvent e) {
          }

          public void windowLostFocus(WindowEvent e) {
           if(mPopupMenu != null && mPopupMenu.isVisible()) {
View Full Code Here


    gb.setConstraints(strut, gc); panel.add(strut);
    JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE,
        JOptionPane.OK_CANCEL_OPTION);
    pane.setInitialValue(field);
    JDialog dlog = pane.createDialog(frame, Strings.get("circuitNameDialogTitle"));
    dlog.addWindowFocusListener(new WindowFocusListener() {
      public void windowGainedFocus(WindowEvent arg0) {
        field.requestFocus();
      }

      public void windowLostFocus(WindowEvent arg0) { }
View Full Code Here

    UiUtilities.centerAndShow(mDialog);
    mDialog.toFront();

    if(mDialog.isAlwaysOnTop()) {
      mDialog.addWindowFocusListener(new WindowFocusListener() {
        public void windowGainedFocus(final WindowEvent e) {
        }

        public void windowLostFocus(final WindowEvent e) {
          mDialog.setAlwaysOnTop(false);
View Full Code Here

        if(e.getID() == WindowEvent.WINDOW_STATE_CHANGED)
          ((Window)e.getSource()).validate();
      }});

        // When recieving focus, select the chat box
        addWindowFocusListener(new WindowFocusListener() {
      @Override
      public void windowGainedFocus(WindowEvent e) {
        if(selectedGui != null)
          selectedGui.getFrame().requestFocus();
      }
View Full Code Here

    frame.add(jsp);

    // Initialize the TC popup window
    tcPopupWindow = new JDialog();
    tcPopupWindow.setUndecorated(true);
    tcPopupWindow.addWindowFocusListener(new WindowFocusListener() {
      @Override
      public void windowGainedFocus(WindowEvent e) {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
View Full Code Here

    public static WindowFocusListener createAndInstallRepaintWindowFocusListener(Window window) {

        // create a WindowFocusListener that repaints the window on focus
        // changes.
        WindowFocusListener windowFocusListener = new WindowFocusListener() {
            public void windowGainedFocus(WindowEvent e) {
                e.getWindow().repaint();
            }

            public void windowLostFocus(WindowEvent e) {
View Full Code Here

        color = focused ? fFocusedColor : fUnfocusedColor;
        fComponentToTrackFocusOf.repaint();
    }

    private WindowFocusListener createWindowFocusListener() {
        return new WindowFocusListener() {
            public void windowGainedFocus(WindowEvent e) {
                updateColor(true);
            }
            public void windowLostFocus(WindowEvent e) {
                updateColor(false);
View Full Code Here

        }
    }

    protected void processWindowFocusEvent(WindowEvent e) {
        for (Iterator<?> i = windowFocusListeners.getUserIterator(); i.hasNext();) {
            WindowFocusListener listener = (WindowFocusListener) i.next();
            switch (e.getID()) {
                case WindowEvent.WINDOW_GAINED_FOCUS:
                    listener.windowGainedFocus(e);
                    break;
                case WindowEvent.WINDOW_LOST_FOCUS:
                    listener.windowLostFocus(e);
                    break;
            }
        }
    }
View Full Code Here

        // TODO Auto-generated method stub
        //addPlotDialog PlotDialog = new addPlotDialog();
        PlotDialog.setVisible(true);
      }
    });
    addWindowFocusListener(new WindowFocusListener() {
     
      @Override
      public void windowLostFocus(WindowEvent e) {
        // TODO Auto-generated method stub
       
View Full Code Here

                        content.fireSelected(false);
                        content.setDetached(false);
                    }
                });

                dialog.addWindowFocusListener(new WindowFocusListener() {
                    public void windowGainedFocus(WindowEvent e) {
                        if (!valueAdjusting && !contentValueAdjusting) {
                            PlafContent newSelected = (PlafContent) contentManager.getContentByComponent(
                                    dialog.getContentPane().getComponent(0));
View Full Code Here

TOP

Related Classes of java.awt.event.WindowFocusListener

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.