Java Swing Interview Questions and Answers - 2

Question: 6

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: 7

Which package has light weight component?

javax.Swing package contains light weight components.

All components in Swing, except JApplet, JDialog, JFrame and JWindow are lightweight components.

Question: 8

Name Container classes?

Window,

Frame,

Dialog,

FileDialog,

Panel,

Applet or ScrollPane.

Question: 9

Name the containers which use Border Layouts as their default layout?

Window, Frame and Dialog classes.

Question: 10

Which container method is used to cause a container to be laid out and redisplayed?

validate()

Related Questions