0% found this document useful (0 votes)
38 views4 pages

AJP Unit-I ByOmiii

The document is a question bank for the Advanced Java Programming course at Maratha Mandal's Polytechnic in Pune, India. It contains 33 multiple choice questions about the Abstract Window Toolkit (AWT) in Java. Some key topics covered include AWT components like containers, controls, layout managers, frames, menus and how to work with them.

Uploaded by

Omanand Swami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views4 pages

AJP Unit-I ByOmiii

The document is a question bank for the Advanced Java Programming course at Maratha Mandal's Polytechnic in Pune, India. It contains 33 multiple choice questions about the Abstract Window Toolkit (AWT) in Java. Some key topics covered include AWT components like containers, controls, layout managers, frames, menus and how to work with them.

Uploaded by

Omanand Swami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MARATHAWADA MITRAMANDAL’S POLYTECHNIC, THERGAON, PUNE-33

Academic Year 2019-2020

Program: CO5I Course: Advanced Java Programming (22517) Course Co-ordinator: Mrs.Chavan P.P.
Unit I- Abstract Window Toolkit
Question Bank

Sr.No. Question Option A Option B Option C Option D

1 Give the Abbreviation of AWT : Applet WindowingToolkit Abstract Window Absolute Windowing Toolkit None of these
Toolkit
Which is a component in AWT that can contain another components like
2 Window Container Panel Frame
buttons, textfields, labels etc.?

Which class provides many methods for


3 java.awt java.Graphics None of these
graphics programming? java.awt.Graphics
Which is the container that doesn't contain title
4 bar and MenuBars. It can have other components Window Frame Panel Container
like button, textfield etc ?

Which object can be constructed to show any


5 Choice Menu Checkbox
number of choices in the visible window? List
By which method we can set or change the text
6 setText() getText() addText() all of these
in a Label in AWT?

Which method of the Applet class displays the


7 run() method paint() method drawString() method main() method
result of applet code on screen ?

8 Applet can be embedded in . HTML document word document gif file rtf file

Applets must run under The user I/O is not


Applets do not have mairu)
9 Which of the following is true about applet ? appletviewer or web performed using Java's all of these
method
browser stream I/O class

What does the following line of code do ? Creates text object that can Creates text object that Creates the object text and
10
can hold 20 columns of initializes it with the value 20 This is invalid code
Textfield text = new Textfield(20); hold 20 rows oftext.
text.

11 Executable applet is .applet file .java html .java file .class file
12 Java applet are used to create applications. graphical user interactive both (a) and (b) none of the above

Which of these functions is called to display the


13 display() paint() display Applet() Show()
output of an applet ?

Which of these methods is a part of Abstract


14 display() paint() Show() all of the above
Window Toolkit (AWT) ?

Which object can be constructed to show any number of choices in the


15 Labels choice List Checkbox
visible window?

16 Which of the following class is derived from the container class? Component Panel MenuComponent List

When we invoke repaint() for a java.awt.Compdnent object, the AWT


17 draw() update() Show() paint()
invokes the method:

18 Which method executes only once? start() stop() init() destroy()

Which of these classes can be added to any Container class, using the add
19 Button CheckboxMenuItem Menu MenuBar
method defined in Container class?

Which of the following methods can be used to


20 dimension() setSize() area() size()
change the size of a java.awt.Component object ?

Which of the following methods can be used to remove a


21 disappear() delete() remove() hide()
java.awt.Component object from the display?

These two ways are used to create a Frame 1. By creating the object of
22 TRUE FALSE
Frame class (association) 2. By extending'Prame class (inheritance)

23 The title of the frame can be set in AWT using the method. setHeading setTitle CreateTitle Settitle

Which are passive controls that do not support any interaction with the
24 Choice List Label Checkbox
user?

How many ways can we align the label in a container? 1 2 4


25
3
Scroll bars, text area, text
26 The various controls supported by AWT are Labels, push buttons Checkboxes, choice, list All of these
field

Which layout manager places components in one of five regions: north,


27 AbsoluteLayout GridLayout BorderLayout FlowLayout
south, east, west, and center?
28 layout arranges the components horizontally: BorderLayout CardLayout GridLayout FlowLayout

29 The most commonly used layout managers are FlowLayout GridLayout BorderLayout All of these

30 The subclasses of Window are Dialog Frame Both a & b None of these

31 Default layout manager for subclasses of window is _ cardlayout GridBaglayout Frame BorderLayout

32 Each menu is associated with a list of menu items: Checkbox Drop-down Choice None of these

Which class can be used to represent a checkbox with a textual label that
33 MenuBar MenuItem CheckboxMenuIte Menu
can appear in a menu ?
m

34 Which abstract class is the super class of all menu related classes? MenuComponent MenuBar MenuItem CheckboxMenuItem

35 Menu items are added to Menus MenuBar Frame Both a & b

36 Dialog box does not have minimize and maximize button TRUE FALSE

A dialog box is referred to as modeless if the user does not have to close it
37 TRUE FALSE
in order to continue using the application that owns the dialog box.

38 The class displays a dialog window from which the user can select a file. Dialog FileDialog File None of these

The setBackground() method is part of the following class in java.awt


39 Graphics Applet Container Component
package:

new TextArea(new
40 Which constructor creates a TextArea with 10 rows and 20 columns? Rows(10), new new TextArea(20, 10). new new TextArea(200).
columns(20)).
TextArea(10, 20).
Which of the following creates a List with 5 visible items and multiple
41 new List(true, 5). new List(5, true). new List(5, false). new List(false,5).
selection enabled?

A Frame's background color is set to Color.Yellow, and a Button's


background color is to Color.Blue.Suppose the Button is added to a Panel,
42 Color.Yellow. Color.Blue. Color.Green. Color.White
which is added to the Frame. What background color will be used with the
Panel?
43 Which method will cause a Frame to be displayed? paint( ) setVisible( ) display( ) displayFrame( )

44 Which of the following components allow multiple selections? Combo box. Radio buttons. Choice. List.

45 Which method is method to set the layout of a container? startLayout( ). initLayout( ). layoutContainer( ). setLayout( ).

Which layout should you use to organize the components of a container in


46 CardLayout. BorderLayout. FlowLayout. GridLayout
a tabular form?

Pass a X/Y percentage


How do you indicate where a component will be positioned using Assign a row/column grid Do nothing, the
47 North, South,East,West. parameter to the add
Flowlayout? reference
method. FlowLayout will
position the
component.

48 Which of the following may contain a menu bar? A panel. .A frame. An applet. A menu bar.

A MenuItem can be added to .A Dialog can be added to a


49 Which of the following are true? A Dialog can have a MenuItem extends Menu.
a Menu. Menu.
MenuBar.
Which of the following would create a text field able to display 10
50 new new TextField("hello"); new textField(10); new TextField();
characters (assuming a fixed size font) displaying the initial string "hello":
TextField("hello",
10);
Using a FlowLayout manager, which is the correct way to add elements to a
51 add(x, y, component); set(component); add(component add("Center", component);
container
);
52 Which object is needed to group Checkboxes to make them exclusive? RadiobuttonGroup. CheckboxGrou ControlGroup. GroupCheckbox
p.
A MenuItem can be added to A Menu can be added to a
53 Which of the following are true? A Dialog can have a MenuItem extends Menu.
a MenuItem Menu.
MenuBar.
Arranges the components as a deck of cards such that only one component
54 BorderLayout CardLayout GridLayout FlowLayout
is visible at a time

55 creates a dropdown list of textual entries Choice Checkbox Textbox TextComponent

56 Panel is used for components Managing Deleting Modifying


Grouping
is a superclass of TextField and TextArea classes that is used to
57 TextBox CheckBox TextComponent Choice
create single-line or multiline textfields respectively

You might also like