Professional Documents
Culture Documents
unit-test-1-ajp
unit-test-1-ajp
1 A _____ is a passive AWT control that do not generate any event? Button RadioButton Choice Label
2 ActionEvent Class is used for Which Controll ? List,Button, Checkbox Label, Button, List Menu, Label, ScollBar None of these
Arranges the components as a deck of cards such that only one
3 BorderLayout CardLayout GridLayout FlowLayout
component is visible at a time
4 AWT components are ..... Platform dependent Platform Independent Both A & B None of Above
5 Change in the state of an object is known as __________ EventSource Event EventHandler Listner
6 Event Listeners are__________________________________ Class Interface Object None of these
To create a slider that allows
To display a drop-down To create a panel with a
7 In AWT, what is the purpose of the Scrollbar component? the user to select a value To display a progress bar
list of items border
from a range
In AWT, which class is used to create a window with a title bar,
8 Panel Window Frame Container
borders, and buttons?
In AWT, which layout manager automatically resizes components
9 FlowLayout BorderLayout GridLayout GridBagLayout
to fill available space?
Modelling Visual Model View Model Viewable Many View
10 MVC architecture is _________
Controller Controller Controller Controller
The following way is used to create a frame is by creating the
11 inheritance association Both A & B None of the above
object of Frame class?
The action command
The label text of a The name of an AWT The text entered in a
12 The getActionCommand() method is used to retrieve: associated with a
component component TextField
component
The getSelectedIndex() method is commonly used with which
13 RadioButton CheckBox List ComboBox
AWT component?
Enable event handling for a Disable event handling Make a component
14 The setEnabled() method is used to: Make a component visible
component for a component invisible
Set the position of a Set the layout manager Set the background color Set the size of a
15 The setLayout() method is used to:
component for a container of a component component
Set the position of a Set the size of a Set the layout manager for
16 The setSize() method is used to: Set the title of a frame
component component a container
Set the text of a Label Set the layout of a GUI Set the background color
17 The setText() method is commonly used to: Set the title of a Frame
component component of a component
Make a component
18 The setVisible(true) method is used to: Make a component invisible Enable event handling Disable event handling
visible
tells what should
tell which region to put the tells the color of the tells what text will appear
19 The String parameter to Button constructor ______________. happen when Button is
Button in. Button. on Button.
pressed.
What does the following line of code do? TextField tf = new will set 10 to TextField as its will set the character
20 Both A & B None of These
TextField(10); initial text. capacity to 10
21 What is the default layout manager for a Frame in AWT? FlowLayout BorderLayout GridLayout GridBagLayout
Create a grid of Allow precise control
Divide the container into five Arrange components in a
22 What is the purpose of the FlowLayout layout manager? components with fixed over component
areas single row
rows and columns placement
35 Which method is used to set password character for a TextField? setPasswordCharacter( ) setEchoChar( ) setPassChar( ) setEchoCharacter( )
36 Which method is used to set the title of a Frame in AWT? setTitle() setLabel() setText() setCaption()
Which object can be constructed to show any number of choices
37 Labels Choice List Checkbox
in the visible window?
Which of the following creates a List with 5 visible items and
38 new List(5, true) new List(true, 5) new List(5, false) new List(false,5)
multiple selection enabled?*
39 Which of these events is generated when a button is pressed? ActionEvent ItemEvent WindowEvent MouseEvent
Which package provides many event classes and Listener
40 java.awt java.awt.Graphics java.awt.event None of the above
interfaces for event handling?