Пример #1
2
  protected boolean setDir(JTextField txf, String strValue) {
    String strTxt = txf.getText();
    String strName = txf.getName();
    boolean bSet = false;

    if ((strTxt == null || strTxt.trim().length() == 0 || strTxt.equals(INFOSTR))
        && strName.equalsIgnoreCase("value")) {
      if (timer != null) {
        timer.cancel();
        txf.setForeground(Color.black);
      }

      bSet = true;
      txf.setText(strValue);
      txf.grabFocus();
    }
    return bSet;
  }