Java Swing AWT Question:
Download Job Interview Questions and Answers PDF
What is the purpose of action interface in Swing?
Answer:
Action is performed on a state to allow it to change. It defines the interface that it is implementing. The library that is used for the action interface is javax.swing.Action. This action interface extends the ActionListener interface class that is being provided from the AWT. Action interface allow the concrete classes to implement the actionPerformed() method and provide the action that is associated with it. The use of actionPerformed() method allow the implementation of the behavior that is desired in the programming and allow it to show the functionality of the action class. The action can be added to the container class that accepts the parameters on an event like JMenu, JPopupMenu, or JtoolBar. The container used in this automatically registers the action that is taken on the event and it acts as an ActionListener of the user interface.
Download Swing AWT Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain the use of JFC in Java Swing? | What is the function of Abstract Action class? |