Saturday 31 January 2015

Recently asked Java Swing Interview Questions and Answers

71. What is the difference between AWT and SWT? 
SWT : SWT is stands for Standard Widget Toolkit, It is a completely independent Graphical User Interface (GUI) toolkit from IBM. They created it for the creation of Eclipse Integrated Development Environment (IDE). AWT is from Sun Microsystems.

72. 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.

73. What is a convertor?
Converter is bassically an application that converts distance measurements between metric and U.S units.

74. What is the difference between a Canvas and a Scroll Pane?
Many diff are there : 
> 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.

75. 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.

76. 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.

77. 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.

78. How the Canvas class and the Graphics class are related?
A Canvas object provides access to a Graphics object via its paint() method.

79. 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.

80. 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.
More Questions & Answers :-
Part1  Part2  Part3  Part4  Part5  Part6  Part7  Part8  Part9

No comments:

Post a Comment