Package javax.swing

Examples of javax.swing.JTextField.requestFocus()


    } catch(NumberFormatException nfe) {
      if (isInteger)
        JOptionPane.showMessageDialog(null, Messages.getString("QuantAna.Message.NumberFormatErrorInt"));
      else
        JOptionPane.showMessageDialog(null, Messages.getString("QuantAna.Message.NumberFormatErrorDouble"));
      tf.requestFocus();
      tf.selectAll();
      errorDetected = true;
    }
  }
 
View Full Code Here


      if (!(tmp < 1)) throw new InvalidThresholdException();
     
      errorDetected = false;
    } catch(InvalidThresholdException ite){
      JOptionPane.showMessageDialog(null, Messages.getString("QuantAna.Message.InvalidThreshold"));
      tf.requestFocus();
      tf.selectAll();
      errorDetected = true;
    } catch(NumberFormatException nfe) {
      JOptionPane.showMessageDialog(null, Messages.getString("QuantAna.Message.NumberFormatErrorDouble"));
      tf.requestFocus();
View Full Code Here

      tf.requestFocus();
      tf.selectAll();
      errorDetected = true;
    } catch(NumberFormatException nfe) {
      JOptionPane.showMessageDialog(null, Messages.getString("QuantAna.Message.NumberFormatErrorDouble"));
      tf.requestFocus();
      tf.selectAll();
      errorDetected = true;
    }
  }
 
View Full Code Here

        }
      }
    });
    this.pack();
    this.setVisible(true);
    jtxfInput.requestFocus();
  }

  public UserInputDialog(Frame parent, String title, boolean bModal, String attribName)
  {
    this(parent, title, bModal, attribName, "");
View Full Code Here

      longVal = Long.parseLong(temp.getText());
    } catch (NumberFormatException err) {
      JOptionPane.showMessageDialog(this, "This field must have a long value!", "Value Required",
          JOptionPane.ERROR_MESSAGE);
      temp.setText(defaultValue);
      temp.requestFocus();
    }
    return longVal;
  }
}
View Full Code Here

                final int ch = e.getKeyCode();
                if (ch == KeyEvent.VK_UP && list.getSelectedIndex() == 0) {
                    application.invokeLater(new Runnable() {
                        @Override
                        public void run() {
                            typeToSearchField.requestFocus();
                        }
                    });
                } else if (ch == KeyEvent.VK_ESCAPE) {
                    application.invokeLater(new Runnable() {
                        @Override
View Full Code Here

                    otherP.dispose();
                }
                popup.setLocation((int) (l.getX() + menu.getBounds().getWidth()), (int) l.getY() - 1);
                popup.pack();
                popup.setVisible(true);
                typeToSearchField.requestFocus();
                typeToSearchField.selectAll();
                /* Setting location again. Moving it one pixel fixes
                the "gray window" problem. */
                popup.setLocation((int) (l.getX() + menu.getBounds().getWidth()), (int) l.getY());
            }
View Full Code Here

      JOptionPane.showMessageDialog(this,
          "This field must have a long value!",
          "Value Required",
          JOptionPane.ERROR_MESSAGE);
      temp.setText(defaultValue);
      temp.requestFocus();
    }
    return longVal;
  }

}
View Full Code Here

    add(deviceNames, BorderLayout.NORTH);
    add(centerWrapper, BorderLayout.CENTER);
    add(bottomRow, BorderLayout.SOUTH);
    pack();
    SwingHelper.centerTo(owner, this);
    bandwidth.requestFocus();
    setVisible(true);
  }
}
View Full Code Here

      {
        Component comp = super.getTableCellEditorComponent(table, value, isSelected, row, column);
        if (value instanceof File)
        {
          tf.setText(chooser.getName((File) value));
          tf.requestFocus();
          tf.selectAll();
        }
        return 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.