Professional Documents
Culture Documents
Unit II
Unit II
Program: CO5I Course: Advanced Java Programming (22517) Course Co-ordinator: Mrs.Chavan P.P.
Unit II- Swing
Question Bank
Sr.
Question Option A Option B Option C Option D
No.
3 Swing is based on __ architecture client server model view controller layered none of these
5 In Swing JButton class is derived from __ . AbstractButton JToggleButton Jcomponent None of these
6 In Swing class hierarchy the class present at the rootis ____ Component Window Container Object
7 ________pane can be used to add component to container Glass Content Container All of above
8 To represent Icon file in swing label we use setimg setIcon setLabelIcon None of these
Scrollbar is component and Scrollbar is container and Scrollbar and Scrollpane both Scrollbar and Scrollpane both
10 The difference between Scrollbar and Scrollpane is _______ Scrollpane is Scrollpane is are components are container and
container component and not containers not components
11 MVC stands for ______ Model Version Control Model View Controller Mini View Controller Major View Controller
12 In swing _______ gives the visual representation of the component Model View Controller None of these
13 JPanel and Applet use____________ as their default layout FlowLayout GridLayout BorderLayout Gridbagl.ayout
14 Which of the following component multiple selection? Jlist JComboBox JLAbel All of the above
Select the correct source code using swing for generating following
output.
public class AppletDemo public class AppletDemo
public class AppletDemo public class AppletDemo
extends JApplet extends JApplet
{ extends JApplet
{ {
public void {
public void public void
paint(Graphics g) public void paint(Graphics
paint(Graphics g) paint(Graphics g)
{ g)
15 { {
g.drawString("WELCOME {
g.msg("WELCOME TO g.drawString("WELCOME
TO SWING g.display('WELCOME TO
SWING TO SWING
PROGRAM',20,40); SWING PROGRAM",20.40);
PROGRAM",20,40); PROGRAM",20,40);
} }
} }
} }
} }
17 List, choiceButton,ImageIcon ComboBox, Image Icon,Label List and Image leon ComboBox and Image leone
To generate following output the components that are used are _
The following
a) It is lightweight.
35 b) It supports pluggable look and feel. Swing AWT Both A & B None of these
c) It follows MVC (Model View Controller) architecture
are the advantages of _____ .