Awt(Engineering > Computer Science And Engineering ) Questions and Answers
Question 1. Which class can be used to represent a checkbox with a textual label that can appear in a menu.
MenuBar
MenuItem
CheckboxMenuItem
Menu
Explanation:-
Answer: Option C. -> CheckboxMenuItem
Question 2. Which class provides many methods for graphics programming?
java.awt
java.Graphics
java.awt.Graphics
None of the above
Explanation:-
Answer: Option C. -> java.awt.Graphics
Question 3. By which method You can set or change the text in a Label?
setText()
getText()
Both A & B
None of the above
Explanation:-
Answer: Option A. -> setText()
Question 4. The following specifies the advantages of It is lightweight. It supports pluggable look and feel. It follows MVC (Model View Controller) architecture.
Swing
AWT
Both A & B
None of the above
Explanation:-
Answer: Option A. -> Swing
Question 5. The Java Foundation Classes (JFC) is a set of GUI components which simplify the development of desktop applications?
True
False
All of these
None
Explanation:-
Answer: Option A. -> True
Question 6. Which is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfield etc?
Window
Frame
Panel
Container
Explanation:-
Answer: Option C. -> Panel
Question 7. In Graphics class which method is used to draws a rectangle with the specified width and height?
public void drawRect(int x, int y, int width, int height)
public abstract void fillRect(int x, int y, int width, int height)
public abstract void drawLine(int x1, int y1, int x2, int y2)
public abstract void drawOval(int x, int y, int width, int height)
Explanation:-
Answer: Option A. -> public void drawRect(int x, int y, int width, int height)
Question 8. Which package provides many event classes and Listener interfaces for event handling?
java.awt
java.awt.Graphics
java.awt.event
None of the above
Explanation:-
Answer: Option C. -> java.awt.event
Question 9. Name the class used to represent a GUI application window, which is optionally resizable and can have a title bar, an icon, and menus.
Window
Panel
Dialog
Frame
Explanation:-
Answer: Option D. -> Frame
Question 10. The Swing Component classes that are used in Encapsulates a mutually exclusive set of buttons?