Thursday, June 17, 2010

SWING/AWT interview questions.

1QWhat is JFC?
AJFC stands for Java Foundation Classes. The Java Foundation Classes (JFC) are a set of Java class libraries provided as part of Java 2 Platform, Standard Edition (J2SE) to support building graphics userinterface (GUI) and graphics functionality for client applications that will run on popular platforms such as Microsoft Windows, Linux, and Mac OSX.
2Q What is AWT?
AAWT 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.
3Q What are the differences between Swing and AWT?
AAWT is heavy-weight components, but Swing is light-weight components. AWT is OS dependent because it uses native components, But Swing components are OS independent. We can change the look and feel in Swing which is not possible in AWT. Swing takes less memory compared to AWT. For drawing AWT uses screen rendering where Swing uses double buffering.
4Q What are heavyweight components ?
A A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer).
5Q What is lightweight component?
AA lightweight component is one that "borrows" the screen resource of an ancestor (which means it has no native resource of its own -- so it's "lighter").
6QWhat is double buffering ?
ADouble buffering is the process of use of two buffers rather than one to temporarily hold data being moved to and from an I/O device. Double buffering increases data transfer speed because one buffer can be filled while the other is being emptied.
7QWhat is an event?
AChanging the state of an object is called an event.
8Q What is an event handler ?
AAn event handler is a part of a computer program created to tell the program how to act in response to a specific event.
9QWhat is a layout manager?
AA layout manager is an object that is used to organize components in a container.
10Q What is clipping?
AClipping is the process of confining paint operations to a limited area or shape.
11QWhich containers use a border Layout as their default layout?
AThe window, Frame and Dialog classes use a border layout as their default layout.
12QWhat is the preferred size of a component?
AThe preferred size of a component is the minimum component size that will allow the component to display normally.
13QWhat method is used to specify a container's layout?
AThe setLayout() method is used to specify a container's layout.
14QWhich containers use a FlowLayout as their default layout?
AThe Panel and Applet classes use the FlowLayout as their default layout.
15QWhich method of the Component class is used to set the position and size of a component?
AsetBounds

No comments:

Post a Comment