Package java.awt

Examples of java.awt.Component.addFocusListener()


      return null;
    ((MLocationController)MLocationController.getController(modeController)).moveNodePosition(newNode, -1, pt.x, pt.y);
    final Component component = Controller.getCurrentController().getMapViewManager().getComponent(newNode);
    if (component == null)
      return newNode;
    component.addFocusListener(new FocusListener() {
      public void focusLost(FocusEvent e) {
      }

      public void focusGained(FocusEvent e) {
        e.getComponent().removeFocusListener(this);
View Full Code Here


          forceChange is false, that avoids the two concurrent requestFocus().
        */

        if (!forceChange) {
      final Component c = focuser;
      c.addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent e) {
      if(!DockingUtility.isActive(parentDockable)) {
          parentDockable.getDockingProperties().setActive(true);
      }
      c.removeFocusListener(this);
View Full Code Here

                nextField = addCheckBox( new JLabel( name ) );
            } else {
                nextField = addTextField( new JLabel(name), null );
               
                // set the value on a focus lost event
                nextField.addFocusListener(
                    new FocusAdapter() {
                     
                public void focusLost(FocusEvent e) {
                 
                  // get the fieldname as name of attribute
View Full Code Here

    private void addScrollPane( JScrollPane p )
    {
      final Component c = p.getViewport().getView();
      c.addMouseListener( this );
      c.addFocusListener( this );
      if( DEBUG ) System.err.println( "addFocus/MouseListener " + c.getClass().getName() + "(" + c.hashCode() + ")" );
    }

    private void removeScrollPane( JScrollPane p )
    {
View Full Code Here


                Component editor = row.getEditor(parent);
                if (editor instanceof JComboBox) {
                    ((JComboBox) editor).addActionListener(this);
                    editor.addFocusListener(this);
                } else if (editor instanceof JInputComponent) {
                    JInputComponent input = (JInputComponent) editor;
                    MyDialog dlog;
                    Window parent = AttrTable.this.parent;
                    if (parent instanceof Frame) {
View Full Code Here

                                getFromLocale("attributeChangeInvalidTitle"),
                                JOptionPane.WARNING_MESSAGE);
                    }
                    editor = new JLabel(row.getValue());
                } else {
                    editor.addFocusListener(this);
                }
                currentRow = row;
                currentEditor = editor;
                return editor;
            }
View Full Code Here

      cachedBounds = toolBar.getPreferredSize();
      cachedOrientation = toolBar.getOrientation();

      Component c = e.getChild();
      if (toolBarFocusListener != null)
        c.addFocusListener(toolBarFocusListener);
    }

    /**
     * This method is responsible for giving the child components their
     * original borders when they are removed.
View Full Code Here

          (comp instanceof JTextComponent) ||
          (comp instanceof JList) ||
          (comp instanceof JComboBox) ||
          (comp instanceof JTable))
      {
        comp.addFocusListener(focusListener);
      }
      else if ((comp instanceof JPanel) || (comp instanceof JScrollPane)
          || (comp instanceof JViewport))
      {
        addFocusListener(focusListener, (Container)comp);
View Full Code Here

          (comp instanceof JTextComponent) ||
          (comp instanceof JList) ||
          (comp instanceof JComboBox) ||
          (comp instanceof JTable))
      {
        comp.addFocusListener(focusListener);
      }
      else if ((comp instanceof JPanel) || (comp instanceof JScrollPane)
          || (comp instanceof JViewport))
      {
        addFocusListener(focusListener, (Container)comp);
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.