I came across this code:
public class Board extends JPanel implements ActionListener{
public Board() {
setFocusable(true);
}
}
What exactly does setFocusable(true)
do to the JPanel object? What is the notion of a component being focused?
Based on the Java API, this method is located in the Component class, the super class of JPanel. The method description states "Sets the focusable state of this Component to the specified value. This value overrides the Component's default focusability." This description sounds way too technical and high-level jargon for me (who just finished a Java class in the summer). Sometimes, I think these method descriptions were not written for all people with different levels of knowledge of Java. May someone explain the method description in layman's terms?