Package javax.swing

Examples of javax.swing.JTextField.addFocusListener()


          textfield.setMaximumSize(new Dimension(textfield
              .getMaximumSize().width,
              textfield.getMinimumSize().height));
          label.setLabelFor(textfield);
          textfield.setName(Integer.toString(i));
          textfield.addFocusListener(parameterListener);
          textfield.addKeyListener(parameterListener);
          // The Replayer has a fileName parameter.
          // So with this simple patch we add a FileDialog to select
          // the file. Notice that the constant Replayer.FILE_NAME_PARAMETER
          // makes this patch as less as possible error prone.
View Full Code Here


        probValue.setName(PROBABILITY_INTERVAL_B);
      }
      probValue.setText(probability.toString());
      probLabel.setLabelFor(probValue);

      probValue.addFocusListener(new ProbabilityAdapter());
      probValue.addKeyListener(new ProbabilityAdapter());

      GridBagConstraints c = new GridBagConstraints();
      c.gridwidth = GridBagConstraints.RELATIVE; // next-to-last
      c.fill = GridBagConstraints.NONE; // reset to default
View Full Code Here

    label.setLabelFor(field);
    field.setText(Defaults.get(property));
    // Sets maximum size to minimal one, otherwise springLayout will stretch this
    field.setMaximumSize(new Dimension(field.getMaximumSize().width, field.getMinimumSize().height));
    field.addKeyListener(stringListener);
    field.addFocusListener(stringListener);
    registeredStringListener.add(field);
    cont.add(label);
    cont.add(field);
  }
View Full Code Here

        d = new Dimension(90,30);
        JTextField tolerance = new JTextField(30);
        tolerance.setText(numFormat.format(SolverMultiClosedAMVA.DEFAULT_TOLERANCE));
        tolerance.setMaximumSize(d);
        tolerance.setName(algo.toString());
        tolerance.addFocusListener(new FocusListener() {
          @Override
          public void focusLost(FocusEvent e) {
            JTextField textField = (JTextField) e.getSource();
            Double tol = SolverMultiClosedAMVA.validateTolerance(textField.getText());
            SolverAlgorithm algorithm = SolverAlgorithm.fromString(textField.getName());
View Full Code Here

                    }
                }

                items.add(field);
                inputFields.add(field);
                field.addFocusListener(this);
                field.addKeyListener(this);
                field.addCaretListener(this);
            }
            // --------------------------------------------------
            // if we were not successful creating an input field,
View Full Code Here

    super();
    setLayout(new GridLayout(0, 2));
   
    JLabel l = new JLabel(Messages.getString("Path to") + " ffmpeg");
    JTextField tf = new JTextField(Settings.getPropertyString(ConstantKeys.configuration_ffmpeg));
    tf.addFocusListener(new FocusSettingsAdapter(ConstantKeys.configuration_ffmpeg));
    add(l);
    add(tf);
   
    l = new JLabel(Messages.getString("Path to") + " VLC");
    tf = new JTextField(Settings.getPropertyString(ConstantKeys.configuration_vlc));
View Full Code Here

    add(l);
    add(tf);
   
    l = new JLabel(Messages.getString("Path to") + " VLC");
    tf = new JTextField(Settings.getPropertyString(ConstantKeys.configuration_vlc));
    tf.addFocusListener(new FocusSettingsAdapter(ConstantKeys.configuration_vlc));
    add(l);
    add(tf);
   
    l = new JLabel(Messages.getString("Fullscreen"));
    JCheckBox cb = new JCheckBox("", Settings.getPropertyBoolean(ConstantKeys.configuration_fullscreen));
View Full Code Here

    txtUsername.setFont(new Font("Lucida Fax", Font.PLAIN, 13));
    txtUsername.setBackground(Color.decode("#3b5998"));
    txtUsername.setForeground(Color.WHITE);
    this.add(txtUsername, "cell 0 2,growx");
    txtUsername.setColumns(10);
    txtUsername.addFocusListener(new FocusListener() {

          public void focusGained(FocusEvent e) {
              if (txtUsername.getText().equals("Name")) {
                txtUsername.setText("");
              }
View Full Code Here

    txtEmail.setFont(new Font("Lucida Fax", Font.PLAIN, 13));
    txtEmail.setBackground(Color.decode("#3b5998"));
    txtEmail.setForeground(Color.WHITE);
    this.add(txtEmail, "cell 0 3,growx");
    txtEmail.setColumns(10);
    txtEmail.addFocusListener(new FocusListener() {

          public void focusGained(FocusEvent e) {
              if (txtEmail.getText().equals("Email Address")) {
                txtEmail.setText("");
              }
View Full Code Here

    final JTextField txtExample = new JTextField();
    txtExample.setText("example@example.com");
    txtExample.setBounds(432, 13, 166, 22);
    add(txtExample);
    txtExample.setColumns(10);
    txtExample.addFocusListener(new FocusListener() {

          public void focusGained(FocusEvent e) {
              if (txtExample.getText().equals("example@example.com")) {
                txtExample.setText("");
              }
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.