: Java Swings
Here are the Java Swing Questions and answers with the Free PDFs to download.
1. Package of drawstring() method is
Answer: D. java.awt
This method is used in java,awt package.
2. Which method executes only once
Answer: B. init() method
This method is execute only once
3. Give the abbreviation of AWT?
Answer: B. Abstract Windowing Toolkit
Every Swing component relies on an AWT container
4. Which is the container that contain title bar and can have MenuBars. It can have other components like button, textfield etc.?
Answer: B. Frame
A Frame is a top-level window with a title and a border. The size of the frame includes any area designated for the border
5. Which is a component in AWT that can contain another components like buttons, textfields, labels etc.?
Answer: B. Container
Containers are integral part of SWING GUI components
6. The following specifies the advantages of
It is lightweight.
It supports pluggable look and feel.
It follows MVC (Model View Controller) architecture.
Answer: A. Swing
Swing is a GUI widget toolkit for Java
7. Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI application?
Answer: B. False
8. Which class provides many methods for graphics programming?
Answer: C. java.awt.Graphics
java.awt.Graphics package provide various method for graphics .
9. These two ways are used to create a Frame
By creating the object of Frame class (association)
By extending Frame class (inheritance)
Answer: A. True
A Frame is a top-level window with a title and a border. The size of the frame includes any area designated for the border.
10. The Following steps are required to perform
1) Implement the Listener interface and overrides its methods
2) Register the component with the Listener
Answer: C. Event Handling
Event handling is required when we implements interface.