Ajp CH2 Solved QB
Ajp CH2 Solved QB
Q.1 Pluggable look and feel and lightweight components are the features supported by ____.
a) Swing b) AWT
c) Core Java d) None of these
Q.3 Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI
application.
a) True b) False
Q.4 The Java Foundation Classes (JFC) is a set of GUI components which simplify the
development of desktop applications
a) True b) False
Q.6 _______ is one of the features of object oriented programming that allows creation of
hierarchical classifications.
a) Polymorphism b) Class
c) Inheritance d) Object
Q.9 In swing class hierarchy the class present at the root is ______.
a) Component b) Window
c) Container d) Object
Q.11 Select the correct source code using swing for generating following output.
a) b)
public class AppletDemo extends public class AppletDemo extends
JApplet JApplet
{ {
public void paint(Graphics g) public void paint(Graphics g)
{ {
g.string(“WELCOME TO SWING g.drawString(“WELCOME TO
PROGRAM ”,20,40); SWING PROGRAM ”,20,40);
} }
} }
c) d)
public class AppletDemo public class AppletDemo extends
{ JApplet
public void paint(Graphics g) {
{ public void paint(Graphics g)
g.drawString(“WELCOME TO {
SWING PROGRAM ”,20,40); g.display(“WELCOME TO
} SWING PROGRAM ”,20,40);
} }
}
Q.16 To generate following output the components that are used are _______.
a) b)
c) d)
Q.20 Which method of the component class is used to set the position and size of a
component.
a) setPosition b) setBounds
c) setSize d) None of these
Q.33 ______ represents enterprise data and the business rules that gives access to enterprise
data.
a) Model b) View
c) Controller d) None of these
Q.36 In swing, the content pane can be obtained via method ______.
a) getContentPane b) addContentPane
c) both a&b d) None of these
Q.37 In a swing ____ is a component that display rows and columns of data.
a) table b) card
c) both a&b d) None of these
Q.50 Which component is used for creating a GUI for downloading or transferring of file.
a) JLable b) JButton
c) JProgressBar d) JProgressbar
Q.54 You can create a tool tip for _________with setToolTipText() method.
a) JProgressBar b) JApplet
c) any JComponent d) None of these
Q.55 Which class is provide a general purpose component for implementing divider lines?
a) JProgressBar b) JComponent
c) JTable d) JSeparator
Q.59 JTree has a 'root node' at the top most which is a parent for all nodes in the tree.
a) True b) False