Java Script
Java Script
**
- **Answer:** a. java.awt
3. **What is an event in the delegation event model used by Java programming language?**
- **Answer:** a. An event is an object that describes a state change in a source
6. **A ____ control is a dialogue window that allows the user to pick a file?**
- **Answer:** d. JFileChooser
9. **____ are classes that act as a connection point between event listeners and event
sources?**
- **Answer:** a. Event adapters
11. **How many layout managers are defined in the java.awt package?**
- **Answer:** c. 5
13. **Which method is used to place some text in the text field?**
- **Answer:** B. setText(String str)
16. **Which is the container that doesn't contain a title bar and MenuBars but it can have
other components like a button, textfield, etc?**
- **Answer:** c. Panel
17. **Which of these events will be generated if we close an applet’s window?**
- **Answer:** d. WindowEvent
19. **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
20. **Which layout manager places components in one of five regions: north, south, east,
west, and center?**
- **Answer:** c. BorderLayout
23. **Which class is used to display a list of selectable items in Java Swing?**
- **Answer:** d. JList
24. **Which of these events is generated when the component is added or removed?**
- **Answer:** b. ContainerEvent
25. **Which of the following methods is used to create a new JMenuBar object?**
- **Answer:** a. new JMenuBar()
26. **Which of these methods is a part of the Abstract Window Toolkit (AWT)?**
- **Answer:** c. drawString()
27. **The order of the three top-level elements of the java source file is___.**
- **Answer:** c. Package, Import, Class
28. **Which is the container that doesn't contain a title bar and MenuBars but it can have
other components like a button, textfield, etc?**
- **Answer:** c. Panel
29. **AWT has more powerful components like tables, lists, scroll panes, color chooser,
tabbed pane, etc.**
- **Answer:** b. False
30. **Which are passive controls that do not support any interaction with the user?**
- **Answer:** c. Labels