JSPM’s
Bhivrabai Sawant Polytechnic,
Wagholi, Pune- 412207.
(Academic Year 2024-25)
Assingnment - 2
Sub: Advance Java Programming Subject Code: 22517
Semester: 05
Chapter : 2
Date:
1. Which of the following architecture does the Swing framework use?
a. MVC
b. MVP
c. Layered architecture
d. Master-Slave architecture
2. Which language is used in the swing framework?
a. JavaScript
b. Java
c. React
d. Python
3. A ____ is the abstract foundation class for SWING's non-menu user interface controls?
a. Container
b. JComponent
c. Component
4. A ____ is the basic class for all SWING UI components?
a. Container
b. JComponent
c. Component
5. Swing is not a part of JFC (Java Foundation Classes) that is used to create GUIapplication?
a. True
b. False
6. The following specifies the advantages of -:
It is lightweight.
It supports pluggable look and feel.
It follows MVC (Model View Controller) architecture.
a. Swing
b. AWT
c. Both A & B
d. None of the above
7. Which of the following component gives a drop-down list of options from which to choose?
a. JPanel
b. JButton
c. JComboBox
d. JBox
8. The ____ class serves as the foundation for all Swing components.
a. JButton
b. JComponent
c. JTextField
9. Among AWT and Swing which is platform independent?
a. AWT
b. Swing
10. Swing framework is ____ component?
a. Heavyweight
b. Lightweight
11. An ____ is a short software that runs in a web browser.
a. Application
b. AWT
c. Applet
d. JFrame
12. A ____ is a Swing framework component that offers a scroll bar that may be used to scroll
content in a container.
a. JScrollPanel
b. JScrollBox
c. JScroll
d. JScrollBar
13. A ____ is a container that provides a viewport for showing a piece of a bigger component.
a. JScrollPanel
b. JScrollBox
c. JScroll
d. JScrollPane
14. Which of the following companies are using swing framework?
a. IBM
b. Oracle
c. Microsoft
d. All of the above
15. What is Swing in Java?
a. A programming language
b. A type of dance
c. A graphical user interface (GUI) toolkit
d. A data structure
16. Which class is the base class for all Swing components?
a. java.awt.Component
b. java.awt.Container
c. javax.swing.JComponent
d. javax.swing.JPanel
17. These two ways are used to create a Frame-:
By creating the object of Frame class (association)
By extending Frame class (inheritance)
a. True
b. False
18. The Java Foundation Classes (JFC) is a set of GUI components which simplify the
development of desktop applications.
a. True
b. False
19. Which class is used to create a button in Java Swing?
a. JButton
b. JLabel
c. JRadioButton
d. JTextArea
20. What is the purpose of the setToolTipText() method in JavaSwing?
a. To set the size of a component
b. To set the background color of a component
c. To specify a tooltip text for a component
d. To enable or disable user interaction with a component