Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Q No Question Option A Option B Option C Option D

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

Create a grid of Allow precise control


Arrange components in a Divide the container
23 What is the purpose of the GridLayout layout manager? components with fixed over component
single row into five areas
rows and columns placement
Which AWT component is used to create a checkbox that can be
24 CheckButton Checkbox Option ToggleButton
selected or deselected?
Which AWT component is used to create a group of mutually
25 OptionGroup RadioGroup RadioButtonGroup CheckboxGroup
exclusive radio buttons?
26 Which AWT component is used to create a push button? Button ClickButton PushButton PressButton
Which AWT component is used to create a text control that can
27 TextArea TextField TextPane MultiLineText
display multiple lines of text?
Which AWT component is used to display a drop-down list of
28 SelectList Choice ComboBox Dropdown
items?
Which AWT component is used to display a list of items from
29 List SelectList Choice ComboBox
which the user can select one or more?
GridLayout(int
GridLayout(int rows, int
30 Which is the correct constructor of GridLayout. GridLayout(int a) num_rows, int GridLayout(int hor)
cols, int vert)
num_columns)
Which layout manager places components in one of five regions:
31 AbsoluteLayout GridLayout BorderLayout FlowLayout
north, south, east, west, and center?
32 Which method can set or change the text in a Label? setText() getText() All the above None of the above
Which method is used to add a component to a container in
33 add() attach() insert() place()
AWT?
34 Which method is used to add an ActionListener to a button? addActionListener() addClickListener() addEventHandler() attachActionListener()

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?

You might also like