Interviewer And Interviewee Guide

Swing AWT Interview Question:

What is the function of Abstract Action class?

Submitted by: Administrator
AbstractAction class allows the implementation of the abstract functions and the action interfaces. AbstractAction provides with the default functionality that are provided with the methods in the Action interface. The action can extend the class to create some specific actions for the users. The methods that is provided to implement the actionPerformed() method and it is used to provide the overall functionality for the action. ActionEvent is used to show the action command that can be used to add some features of the contents and provide ready to use action functionality on the event that can be carried for all the user interface fields.

class MyAction extends AbstractAction
{ }
public MyAction(String text, Icon icon)
{ super(text,icon); }
public void actionPerformed(ActionEvent e)
{ System.out.println("Action ["+e.getActionCommand()+"]!"); }
Submitted by: Administrator

Read Online Swing AWT Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.