Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Assignment 2

1) Which language is used in the swing framework?

a) React
b) JavaScript
c) Java
d) Python

2) ____ is the parent class for all SWING UI components?

a) Container
b) Jcomponent
c) Component

3) Which of the following architecture does the Swing framework use?

a) MVC
b) MVP
c) Layered architecture
d) Master-Slave architecture

4) Which of the following component gives a drop-down list of options from which to choose?

a) JPanel
b) JButton
c) JComboBox
d) JBox

5) Swing components are part of________

a) Java Standard Edition


b) Java Variables
c)Java Foundation Class
d)Java Resource Management

6) Among AWT and Swing which is platform independent?

a) AWT
b) Swing

7) Swing framework is ____ component?

a) Heavyweight
b) Lightweight

8) An ____ is a short software that runs in a web browser.

a) Application
b) AWT
c) JApplet
d) JFrame

9)Which class is the base class for all Swing components?


a) java.awt.Component
b) java.awt.Container
c) javax.swing.JComponent

10) Which of the following components can display images?


a) JTextArea
b) JTable
c) JList
d) JLabel

11) Which of the following methods is used to set the size of a swing component?
a) setSized()
b) setPreferredSize()
c) setBounds()
d) setMinimumSize()

12) Which of the following methods is used to set the title of a JFrame?
a) setTitle()
b) setLabel()
c) setText()
d) setCaption()

13) Which layout manager is used by default for JFrame?


a) BorderLayout
b) FlowLayout
c) GridLayout
d) CardLayout

14) In MVC architecture M stands for

a) Main
b) Major
c) Model
d) All of the above
15) Swing follows which of the following default pluggable look and feel,.

a) Windows
b) Motif
c) Metal
d) None of the above

16) Swing support MVC

a) True
b) False

17)Root Pane for JFrame contain____

a) MenuBar
b) Glass Pane
c) Layered Pane
d) Content Pane
e) All of the above

18)Root Pane of JApplet contain MenuBar

a) True
b) False

19)Root Pane of JDialog contain MenuBar

a) True
b) False

20) Which of the following is correct constructor for JFrame

a) JFrame()
b) JFrame(String tit)
c) All of the above
d) None of the above

21) JLabel is a_____ component.

a) Passive
b) Editable

22)Is it possible to display Image on swing components


a) Yes
b) No

23)JComboBox is similar to __ component of AWT

a) List
b) Choice
c) TextArea
d) CheckBox

24) ___ component is used to generate ActionEvent on Click or pressed

a) JButton
b) JLabel
c) None of the above
d) Both

25) Which of the following allows to select only one option at a time

a) JradioButton
b) JCheckBox
c) List
d) None of the above

26) JProgressBar() crate ______ProgressBar

a) Horizontal
b) Vertical

27) JTree create______ view of data

a) Circular
b) Straight forward
c) Hierarchical
d) Other than above

28) To create tree node ,use

a) DefaultMutableTreeNode
b) DefaultTreeNode
c) TreeNode
d) Node

29) Which of the following is advanced component of Swing


a) JRadioButton
b) JTable
c) JCheckBox
d) JLabel

30) To set toolTip which method is used

a) setToolTips()
b) setToolTipText()
c) SetToolTip()
d) setTipForTool()

31)Swing pluggable look and feel provides____ no of standard looks

a) 1
b) 2
c) 3
d) 4

32)________method is used to set current value on ProgressBar

a) SetInt()
b) setValue()
c) setProgressBar()
d) value()

33)________ method used to set string on progressbar

a) setprogress()
b) setStringto()
c) setString()
d) none of the above

34) To display value or string on ProgressBar

a) setDisplay()
b) displayall()
c) setStringPainted()
d) paintedon()

35) Can we generate event on JTable

a) Yes
b) No

You might also like