Examples of InputVerifier


Examples of javax.swing.InputVerifier

    lblClientsPort.setText(Integer.toString(Globals.DEFAULT_CLIENT_PORT));
    lblServerPort.setText(Integer.toString(Globals.DEFAULT_SERVER_PORT));
    lblServerIP.setText(Globals.DEFAULT_SERVER_IP);   
    contentPanel.setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{lblNickname, tfNickname, lbl4, lblServerIP, lbl1, lblServerPort, lbl7, lblClientsPort, okButton, cancelButton}));
   
    _nicknameVerifier = new InputVerifier() {
        public boolean verify(JComponent comp) {
           
          JTextField textField = (JTextField) comp;
          return (!textField.getText().isEmpty());
        }
View Full Code Here

Examples of javax.swing.InputVerifier

   
    /** installs an InputVerifier depending on
     *  validationPolicy.
     */
    protected void installInputVerifier() {
        getComponent().setInputVerifier(new InputVerifier() {
            public boolean verify(JComponent input) {
                if (validationPolicy != AUTO_VALIDATE_NONE) {
                    boolean isValid = isValid();
                    if (!isValid && validationPolicy == AUTO_VALIDATE_STRICT) {
                        return false;
View Full Code Here

Examples of javax.swing.InputVerifier

      @Override
      public void actionPerformed(ActionEvent e) {
        validateStagename(stagenameF, geco, frame);
      }
    });
    stagenameF.setInputVerifier(new InputVerifier() {
      @Override
      public boolean verify(JComponent input) {
        return verifyStagename(stagenameF.getText());
      }
      @Override
      public boolean shouldYieldFocus(JComponent input) {
        return validateStagename(stagenameF, geco, frame);
      }
    });
    add(stagenameF, c);
   
    c.gridy = 1;
    add(new JLabel(Messages.uiGet("StagePanel.ZeroHourLabel")), c); //$NON-NLS-1$
    final SimpleDateFormat formatter = new SimpleDateFormat("H:mm"); //$NON-NLS-1$
    formatter.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$
    final JTextField zerohourF = new JTextField(formatter.format(geco.stage().getZeroHour()));
    zerohourF.setColumns(7);
    zerohourF.setToolTipText(Messages.uiGet("StagePanel.ZeroHourTooltip")); //$NON-NLS-1$
    add(zerohourF, c);
    zerohourF.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        validateZeroHour(formatter, zerohourF, geco);
      }
    });
    zerohourF.setInputVerifier(new InputVerifier() {
      @Override
      public boolean verify(JComponent input) {
        try {
          formatter.parse(zerohourF.getText());
          return true;
View Full Code Here

Examples of javax.swing.InputVerifier

      public void actionPerformed(ActionEvent e) {
        control().validateRegisteredStartTime(runner, regStartF.getText());
        refreshRegistrationPanel();
      }
    });
    regStartF.setInputVerifier(new InputVerifier() {
      @Override
      public boolean verify(JComponent input) {
        control().validateRegisteredStartTime(runner, regStartF.getText());
        refreshRegistrationPanel();
        return true; // always yield focus
      }
    });
   
    archiveF.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        control().validateArchiveId(runner, archiveF.getText());
        refreshRegistrationPanel();
      }
    });
    archiveF.setInputVerifier(new InputVerifier() {
      @Override
      public boolean verify(JComponent input) {
        control().validateArchiveId(runner, archiveF.getText());
        refreshRegistrationPanel();
        return true; // always yield focus
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.