Abstract Window Toolkit (AWT) Interview Questions And Answers
Download AWT Interview Questions and Answers PDF
Strengthen your AWT interview skills with our collection of 41 important questions. These questions are specifically selected to challenge and enhance your knowledge in AWT. Perfect for all proficiency levels, they are key to your interview success. Access the free PDF to get all 41 questions and give yourself the best chance of acing your AWT interview. This resource is perfect for thorough preparation and confidence building.
41 AWT Questions and Answers:
AWT Job Interview Questions Table of Contents:
1 :: What is java Swing?
Swing is a GUI toolkit for Java. It is one part of the Java Foundation Classes (JFC). Swing includes graphical user interface (GUI) widgets such as text boxes, buttons, split-panes, and tables.
Swing widgets provide more sophisticated GUI components than the earlier Abstract Window Toolkit. Since they are written in pure Java, they run the same on all platforms, unlike the AWT which is tied to the underlying platform's windowing system. Swing supports pluggable look and feel – not by using the native platform's facilities, but by roughly emulating them. This means you can get any supported look and feel on any platform. The disadvantage of lightweight components is slower execution. The advantage is uniform behavior on all platforms.
Read MoreSwing widgets provide more sophisticated GUI components than the earlier Abstract Window Toolkit. Since they are written in pure Java, they run the same on all platforms, unlike the AWT which is tied to the underlying platform's windowing system. Swing supports pluggable look and feel – not by using the native platform's facilities, but by roughly emulating them. This means you can get any supported look and feel on any platform. The disadvantage of lightweight components is slower execution. The advantage is uniform behavior on all platforms.
2 :: What is java AWT?
A AWT stands for Abstract Window Toolkit. AWT enables programmers to develop Java applications with GUI components, such as windows, and buttons. The Java Virtual Machine (JVM) is responsible for translating the AWT calls into the appropriate calls to the host operating system.
Read More3 :: What is an event handler?
A An event handler is a part of a computer program created to tell the program how to act in response to a specific event.
Read More5 :: What is source and listener?
A source is an object that generates an event. This occurs when the internal state of that object changes in some way. A listener is an object that is notified when an event occurs. It has two major requirements. First, it must have been registered with a source to receive notifications about specific event. Second, it must implement necessary methods to receive and process these notifications.
Read More6 :: What is the difference between choice and list?
A Choice is displayed in a compact form 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.
Read More7 :: What is a layout manager and what are different types of layout managers available?
A layout manager is an object that is used to organize components in a container. The different layouts are available are FlowLayout, BorderLayout, CardLayout, GridLayout , GridBagLayout, Boxlayout and SpringLayout
Read More8 :: What are types of applets?
There are two different types of applets. Trusted Applets and Untrusted applets. Trusted Applets are applets with predefined security and Untrusted Applets are applets without any security.
Read More9 :: 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.
Read More10 :: How can a GUI component handle its own events?
A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.
Read More11 :: What interface is extended by AWT event listeners?
All AWT event listeners extend the java.util.EventListener interface.
Read More15 :: What is the difference between JFC & WFC?
JFC supports robust and portable user interfaces. The Swing classes are robust, compatible with AWT, and provide you with a great deal of control over a user interface. Since source code is available, it is relatively easy to extend the JFC to do exactly what you need it to do. But the number of third-party controls written for Swing is still relatively small. WFC runs only on the Windows (32-bit) user interface, and uses Microsoft extensions to Java for event handling and ActiveX integration. Because ActiveX components are available to WFC programs, there are theoretically more controls available for WFC than for JFC. In practice, however, most ActiveX vendors do not actively support WFC, so the number of controls available for WFC is probably smaller than for JFC. The WFC programming model is closely aligned with the Windows platform.
Read More16 :: What is the difference between a Canvas and a Scroll Pane?
Canvas is a component. ScrollPane is a container. Canvas is a rectangular area where the application can draw or trap input events. ScrollPane implements horizontal and vertical scrolling.
Read More17 :: What is the difference between a MenuItem and a CheckboxMenuItem?
The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.
Read More18 :: How the Canvas class and the Graphics class are related?
A Canvas object provides access to a Graphics object via its paint() method.
Read More19 :: What is the relationship between clipping and repainting?
When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting.
Read More20 :: When should the method invokeLater() be used?
This method is used to ensure that Swing components are updated through the event-dispatching thread.
Read More21 :: What advantage do Javas layout managers provide over traditional windowing systems?
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.
Read More22 :: What is the difference between a Window and a Frame?
The Frame class extends Window to define a main application window that can have a menu bar. A window can be modal.
Read More23 :: Which is the super class of all event classes?
The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.
Read More24 :: What is the purpose of the enableEvents() method?
The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.
Read More25 :: What is a convertor?
Converter is an application that converts distance measurements between metric and U.S units.
Read More