Package java.awt.event

Examples of java.awt.event.FocusAdapter


                if (treetable.getTable().isEditing()) {
                    treetable.getTable().editingStopped(new ChangeEvent(treetable.getTreeTable()));
                }
      }
        });
        treetable.getTree().addFocusListener(new FocusAdapter() {
      public void focusGained(FocusEvent e) {
        super.focusGained(e);
        mySelectionManager.setUserInputConsumer(this);
      }
        });
View Full Code Here


  }
  public Component getTableCellEditorComponent(JTable arg0, Object arg1, boolean arg2, int arg3, int arg4) {
    final Component result = myProxiedEditor.getTableCellEditorComponent(arg0, arg1,arg2, arg3, arg4);
    if (result instanceof JTextComponent) {
      ((JTextComponent)result).selectAll();
      result.addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent arg0) {
          super.focusGained(arg0);
          ((JTextComponent)result).selectAll();
          result.removeFocusListener(this);
        }
View Full Code Here

    for (final InputColumn<?> column : _columns) {
      if (column instanceof MutableInputColumn<?>) {
        final JXTextField textField = WidgetFactory.createTextField("Column name");
        textField.setText(column.getName());
        final MutableInputColumn<?> mutableInputColumn = (MutableInputColumn<?>) column;
        textField.addFocusListener(new FocusAdapter() {
          @Override
          public void focusLost(FocusEvent e) {
            if (!mutableInputColumn.getName().equals(textField.getText())) {
              mutableInputColumn.setName(textField.getText());
View Full Code Here

  /**
   * Adds AWT focus listener to this component that calls back <code>controller</code>
   * escape method on focus lost event. 
   */
  private void addFocusListener(final PlanController controller) {
    addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(FocusEvent ev) {
        controller.escape();
      }
    });
View Full Code Here

      if (docNumberEditable) {
        controlDocNumber.setRequired(true);
        controlDocNumber.setEnabledOnInsert(true);
        controlDocNumber.setEnabledOnEdit(true);
        controlDocNumber.addFocusListener(new FocusAdapter() {
          public void focusLost(FocusEvent e) {
            form.getVOModel().setValue("docSequenceDOC06",controlDocNumber.getValue());
          }
        });
      }
View Full Code Here

     * before the selection is cleared so to get the desired effect the
     * selection needs to be pushed to the event queue.
     */
    final JComponent field = getTextField();
    if (field instanceof JTextComponent) {
      field.addFocusListener(new FocusAdapter() {
        @Override
        public void focusGained(FocusEvent e) {
          SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              ((JTextComponent) field).selectAll();
View Full Code Here

        col.setPreferredWidth(50);

        grid.getColumnContainer().add(col,null);
      }

      grid.addFocusListener(new FocusAdapter() {
        public void focusLost(FocusEvent e) {
          if (!onValidating)
            grid.getTable().getGrid().stopCellEditing();
        }
      });
View Full Code Here

                }
                refreshBoundTexts();
                lowerBoundTextField.setEnabled(false);
            }
        });
        lowerBoundTextField.addFocusListener(new FocusAdapter() {

            @Override
            public void focusLost(FocusEvent e) {
                lowerBoundTextField.setEnabled(false);
            }
        });
        upperBoundTextField.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                upperBoundTextField.setEnabled(true);
                upperBoundTextField.selectAll();
            }
        });
        upperBoundTextField.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (!upperBoundTextField.getText().equals(upperBound)) {
                    upperBound = upperBoundTextField.getText();
                    if (range != null) {
                        range.setUpperBound(upperBound);
                        firePropertyChange(UPPER_BOUND, null, upperBound);
                    }
                } else {
                    upperBound = upperBoundTextField.getText();
                }
                refreshBoundTexts();
                upperBoundTextField.setEnabled(false);
            }
        });
        upperBoundTextField.addFocusListener(new FocusAdapter() {

            @Override
            public void focusLost(FocusEvent e) {
                upperBoundTextField.setEnabled(false);
            }
View Full Code Here

    layout = new SpringLayout();

    this.setLayout(layout);

    this.addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent e) {
          editorPane.requestFocusInWindow();
        }
      });
View Full Code Here

        }
      });

    splitPane.resetToPreferredSizes();

    this.addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent e) {
          // if we get focus, see what we want to select by default.
          // if there's no to: done, select to:.  if there's no
          // subject, select it.  if both of those are filled out,
          // select the message.
View Full Code Here

TOP

Related Classes of java.awt.event.FocusAdapter

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.