Package javax.swing

Examples of javax.swing.JTextField.addFocusListener()


    JPanel fileWrapper = new JPanel(new BorderLayout(5, 5));
      fileWrapper.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
      final JLabel label = new JLabel(Lang.get("menu.file"));
      final JTextField file = new JTextField((logfile != null)?logfile.getAbsolutePath():"");
        final Color defaultColor = new Color(file.getForeground().getRGB());
        file.addFocusListener(new FocusListener() {
          @Override public void focusLost(FocusEvent e) {}
          @Override
          public void focusGained(FocusEvent e) {
            label.setForeground(defaultColor);
          }
View Full Code Here


    JPanel fileWrapper = new JPanel(new BorderLayout(5, 5));
      fileWrapper.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
      final JLabel label = new JLabel(Lang.get("menu.file"));
      final JTextField file = new JTextField((soundFile != null)?soundFile.getAbsolutePath():"");
        final Color defaultColor = new Color(file.getForeground().getRGB());
        file.addFocusListener(new FocusListener() {
          @Override public void focusLost(FocusEvent e) {}
          @Override
          public void focusGained(FocusEvent e) {
            label.setForeground(defaultColor);
          }
View Full Code Here

                    prepareComponents( (Container) c, outer );
                }
            }
            if (c instanceof JTextField) {
                final JTextField jtf = (JTextField) c;
                jtf.addFocusListener( new FocusListener() {
                    @Override
                    public void focusGained ( FocusEvent e ) {
                        jtf.selectAll();
                    }
View Full Code Here

   * @return the created text field.
   */
  public static JTextField createTextField()
  {
    JTextField tf = new JTextField();
    tf.addFocusListener(new TextComponentFocusListener(tf));
    tf.setFont(ColorAndFontConstants.defaultFont);
    return tf;
  }

  /**
 
View Full Code Here

      };
        deviceChange.addFocusListener(f);
        ifChange.addFocusListener(f);
        deviceFilter.addFocusListener(f);
        ipFilter.addFocusListener(f);
        subFilter.addFocusListener(f);
      p.add(new JLabel(Lang.get("event.from"))); p.add(deviceChange);
      p.add(new JLabel(Lang.get("event.from"))); p.add(ifChange);
      p.add(new JLabel()); p.add(new JLabel("Regular Expression"));
      p.add(new JLabel(Lang.get("filter.name"))); p.add(deviceFilter);
      p.add(new JLabel(Lang.get("filter.status"))); p.add(statusFilter);
View Full Code Here

            result.setPreferredSize(new Dimension(20, result.getPreferredSize().height));
        }

    // Commit changes when focus is lost
    //
    result.addFocusListener(new FocusListener() {
      public void focusLost(FocusEvent e) {
        listener.commitChanges();
      }

      public void focusGained(FocusEvent e) {
View Full Code Here

                   
                    public void changedUpdate(final DocumentEvent e) {
                        s.search();
                    }
                });
                searchField.addFocusListener(new FocusListener() {
                   
                    public void focusGained(final FocusEvent e) {
                    }
View Full Code Here

         @Override public final void keyReleased(KeyEvent e) { vizState.label.put(elt, labelText.getText()); }
      });
      labelText.addActionListener(new ActionListener() {
         public final void actionPerformed(ActionEvent e) { vizState.label.put(elt, labelText.getText()); }
      });
      labelText.addFocusListener(new FocusAdapter() {
         @Override public void focusLost(FocusEvent e) { vizState.label.put(elt, labelText.getText()); }
      });
      final AlloyModel model = vizState.getCurrentModel();
      final AlloyNodeElement elt2;
      if (elt instanceof AlloyType) elt2=model.getSuperType((AlloyType)elt); else if (elt instanceof AlloySet) elt2=((AlloySet)elt).getType(); else elt2=null;
View Full Code Here

         @Override public void keyReleased(KeyEvent e)     { vizState.label.put(rel, labelText.getText()); }
      });
      labelText.addActionListener(new ActionListener() {
         public final void actionPerformed(ActionEvent e)  { vizState.label.put(rel, labelText.getText()); }
      });
      labelText.addFocusListener(new FocusAdapter() {
         @Override public void focusLost(FocusEvent e)     { vizState.label.put(rel, labelText.getText()); }
      });
      final JLabel weightLabel = OurUtil.label("Weight:");
      final JSpinner weightSpinner = new JSpinner(new SpinnerNumberModel(vizState.weight.get(rel), 0, 999, 1));
      weightSpinner.setMaximumSize(weightSpinner.getPreferredSize());
View Full Code Here

   public MyEditor(JTextField textField) {
      super(textField);
       JTextField txt;
            txt = (JTextField) super.getComponent();

      txt.addFocusListener(new FocusAdapter() {
            @Override
         public void focusLost(FocusEvent e) {
            stopCellEditing() ;

                validateValue();
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.