Dear Experts,
The API:
public void setFocusable(boolean focusable)
Sets the focusable state of this Component to the specified value. This value overrides the Component's default focusability.
public void setEnabled(boolean enabled)
Sets whether or not this component is enabled. A component that is enabled may respond to user input, while a component that is not enabled cannot respond to user input. Some components may alter their visual representation when they are disabled in order to provide feedback to the user that they cannot take input.
Note: Disabling a component does not disable its children.
Note: Disabling a lightweight component does not prevent it from receiving MouseEvents.
What I understand disabling a JComponent makes it not able to receive focus, and a component which cannot receive focus is unable to respond to user input.
1. Are these two methods basically the same and there is no preference of the usage one over another?
2. Would someone kindly please explain when to use setFocusable and when to use setEnable, if each of the method has special purpose?
Thanks in advance,
Patrick