/** * Sets the specified boolean to indicate whether or not this * <code>TextComponent</code> should be editable. * A PropertyChange event ("editable") is fired when the * state is changed. * * @param b the boolean to be set * @see #isEditable * @beaninfo * description: specifies if the text can be edited * bound: true */ public void setEditable(boolean b) { if (b != editable) { boolean oldVal = editable; editable = b; if (editable) { setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); } else { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } enableInputMethods(editable); firePropertyChange("editable", Boolean.valueOf(oldVal), Boolean.valueOf(editable)); repaint(); } }
* Sets the specified boolean to indicate whether or not this
* <code>TextComponent</code> should be editable.
* A PropertyChange event ("editable") is fired when the
* state is changed.
*
* @param b the boolean to be set
* @see #isEditable
* @beaninfo
* description: specifies if the text can be edited
* bound: true
*/
public void setEditable(boolean b) {
if (b != editable) {
boolean oldVal = editable;
editable = b;
if (editable) {
setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
} else {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
enableInputMethods(editable);
firePropertyChange("editable", Boolean.valueOf(oldVal), Boolean.valueOf(editable));
repaint();
}
}