/** * Checks whether the value of text field is different from the default * value, i.e., a proper value. * * @return true if a proper value is available */ public boolean hasValue() { return (!m_TextSelection.getText().equals(getDefaultString())); }
/** * Sets the default value. */ public void setDefault() { m_TextSelection.setText(getDefaultString()); m_TextSelection.setCaretPosition(0); }
/** * Sets the current value. * * @param value the value to use, can be null * @return if successfully set */ public boolean setCurrent(T value) { boolean result; String str; result = true; str = getDefaultString(); if (value != null) { try { str = toString(value); } catch (Exception e) { e.printStackTrace(); str = getDefaultString(); result = false; } } m_TextSelection.setText(str); m_TextSelection.setCaretPosition(0); return result; }
m_TextSelection.setText(getDefaultString()); m_TextSelection.setEditable(false); m_TextSelection.setPreferredSize(