Ready to face interview for AWT (Abstract Window Toolkit)? Do not worry, we are here to help you with job interview preparation. If you are preparing for AWT (Abstract Window Toolkit) job interview and not sure which questions are likely asked in interview, we suggest you to go through Wisdomjobs AWT (Abstract Window Toolkit) interview questions and answers page to crack your job interview. AWT is the API mostly used by Java programmers. Using awt, programmers can create scroll, buttons, windows and bars. It is part of Java Foundation classes. Candidates should have good knowledge on Java concepts to secure the job. Below is the list of frequently asked AWT (Abstract Window Toolkit) interview questions and answers which gets you ready to face the interviews:
Question 1. What Are Awt Peers?
Answer :
A component is associated with a standard AWT button object, a peer object and an interfacing button object constructed per the native GUI.
Question 2. What Is The Difference Between A Swing And Awt Components?
Answer :
For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button.
Question 3. What Are The Different Types Of Controls In Awt?
Answer :
The AWT supports the following types of controls:
Question 4. What Are The Benefits Of Swing Over Awt?
Answer :
Question 5. What Are The Component And Container Class?
Answer :
A component is a graphical object.
A few examples of components are:
Question 6. What Is The Use Of The Window Class?
Answer :
Answer :
Clipping is the process of confining paint operations to a limited area or shape.
Question 8. What Is The Parameter Specification For The Public Static Void Main Method?
Answer :
Question 9. What Is The Difference Between The Paint() And Repaint() Method?
Answer :
Question 10. What Interface Is Extended By Awt Event Listener?
Answer :
The java.util.EventListener interface is extended by all the AWT event listeners.
Question 11. What Is A Container In A Gui?
Answer :
A Container contains and arranges other components through the use of layout managers, which use specific layout policies to determine where components should go as a function of the size of the container.
Question 12. What Is The Default Layout For Applet?
Answer :
The default layout manager for an Applet is FlowLayout, and the FlowLayout manager attempts to honor the preferred size of any components.
Question 13. Name Components Subclasses That Support Painting?
Answer :
Question 14. What Is The Difference Between A Menuitem And A Checkboxmenuitem?
Answer :
The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.
Question 15. How Are The Elements Of Different Layouts Organized?
Answer :
FlowLayout: The elements of a FlowLayout are organized in a top to bottom, left to right fashion.
Border Layout: The elements of a BorderLayout are organized at the borders and the centre of a container.
CardLayout: The elements of a CardLayout are stacked, on the top of the other, like a deck of cards.
GridLayout: The elements of a GridLayout are equal size and are laid out using the square of a grid.
GridBagLayout: The elements of a GridBagLayout are organized according to a grid.
Question 16. What Is The Difference Between Grid And Gridbaglayout?
Answer :
In Grid layout the size of each grid is constant where as in GridbagLayout grid size can varied.
Question 17. What Is A Layout Manager?
Answer :
A layout manager is an object that is used to organize components in a container.
Question 18. Where The Cardlayout Is Used?
Answer :
CardLayout is used where we need to have a bunch of panel or frames one laying over another. It is replaced by TabbedPane in Swing.
Question 19. Which Container May Contain A Menu Bar?
Answer :
Frame
Question 20. What Are The Types Of Checkboxes?
Answer :
Java supports two types of checkboxes.
They are:
Question 21. What Is The Difference Between Exclusive And Non Exclusive?
Answer :
Exclusive: Only one among a group of items can be selected at a time. If an item from the group is selected, the checkbox currently checked is deselected and the new selection is highlighted. The exclusive Checkboxes are also called as Radio buttons.
Non Exclusive: Checkboxes are not grouped together and each one can be selected of the other.
Question 22. What Is Paint Method?
Answer :
The AWT uses a Callback mechanism for painting which is the same for heavyweight and lightweight components.
Question 23. What Is The Purpose Of Repaint Method?
Answer :
repaint() requests can erase and redraw (update) after a small time display. When you invoke repaint().
Question 24. Which Containers Use A Border Layout As Their Default Layout?
Answer :
Window Frame and Dialog classes use a Border Layout as their layout.
Question 25. What Is Meant By Controls?
Answer :
Controls are components that allow a user to interact with your application.
Question 26. What Is The Difference Between Choice And List?
Answer :
A choice is displayed in a compact from that requires you to pull it down to see the list of available choices and only one item may be selected from a choice.
A list may be displayed in such a way that several list items are visible and it supports the selection of one or more list items.
Question 27. What Is The Difference Between A Window And A Frame?
Answer :
The Frame class extends Window to define a main application window that can have a menu bar.
Question 28. What Are The Subclasses Of The Container Class?
Answer :
The container class has three major subclasses.
They are:
Question 29. Which Method Is Method To Set The Layout Of A Container?
Answer :
setLayout ()
Question 30. What Are The Default Layouts For A Applet, A Frame And A Panel?
Answer :
For an applet and a panel, Flow layout, and The FlowLayout manager attempts to honor the preferred size of any components.
Question 31. What Is The Difference Between A Scrollbar And A Scrollpane?
Answer :
Question 32. Which Method Will Cause A Frame To Be Displayed?
Answer :
Question 33. How Can We Get All Public Methods Of An Object Dynamically?
Answer :
getMethods(): It return an array of method objects corresponding to the public methods of this class.
getFields(): It returns an array of Field objects corresponding to the public Fields (variables) of this class.
getConstructors: It returns an array of constructor objects corresponding to the public constructors of this class.
Question 34. Which Component Subclass S Used For Drawing And Painting?
Answer :
Canvas
Answer :
It is a simple drawing surface which is used for painting images or to perform other graphical operations.
What is the difference between the Font and FontMetrics classes?
The FontMetrics class is used to define implementation specific properties such as ascent and descent, of a Font object.
Question 36. Explain The Use Of Update Method?
Answer :
An update method is called on calling the repaint method.
The default implementation of the update() method clears the screen and calls the paint() method.
Question 37. Which Containers Use A Flowlayout As Their Default Layout?
Answer :
The Panel and the Applet classes use the Flow Layout as their default layout.
Question 38. What Are The Subclass Of Textcomponent Class?
Answer :
TextField and TextArea
AWT (Abstract Window Toolkit) Related Tutorials |
|
---|---|
Java Script Tutorial | JavaServer Faces (JSF) Tutorial |
Java Swing Tutorial | Java Tutorial |
JavaMail API Tutorial | Java 8 Tutorial |
JSON (JavaScript Object Notation) Tutorial | The Java Debugger (JDB) Tutorial |
AWT (Abstract Window Toolkit) Related Practice Tests |
|
---|---|
Java Script Practice Tests | JavaServer Faces (JSF) Practice Tests |
Java applet Practice Tests | Java 8 Practice Tests |
JSON (JavaScript Object Notation) Practice Tests |
Awt (abstract Window Toolkit) Practice Test
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.