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

1) AWT stands for________

a) Abstract Window Toolkit


b) Advanced Window Toolkit
c) Abstract Window Tool
d) Advanced Window Tool

2) ________ method is used to set layout


a) setLayout()
b) addLayout()
c) add()
d) setBounds()

3) _______ package provides AWT classes in Java?


a) java.awt
b) java.swing
c) java.io
d) java.net

4) the parent class of all AWT components is


a) Panel
b) Component
c) Container
d) Frame

5) Which method is used to add a component to a container in AWT?


a) add()
b) setComponent()
c) addComponent()
d) setLayout()

6) _____ class is used to create a menu bar in AWT


a) java.awt.Menu
b) java.awt.MenuBar
c) java.awt.MenuItem
d) java.awt.PopupMenu

7) Which class is used to create a file dialog in AWT?


a) java.awt.Dialog
b) java.awt.FileDialog
c) java.awt.Frame
d) java.awt.Window

8) Frame can be created


By creating the object of Frame class (association)
By extending Frame class (inheritance)
a) True
b) False

9) Which container doesn’t contain title bar and menubar


a) Window
b) Frame
c) Panel
d) Container

10) Is it possible to select multiple options on List


a) true b)false

11) Which is parent class of all menu related classes


a) Component
b) MenuComponent
c) Container
d) JComponent

12) Which of the following is a Passive Component


a) Button
b) TextField
c) Label
d) CheckboxGroup

13) Is Component derived from Container


a)true
b)false

14) Which of the following is not constructor for Button


a) Button()
b) Button(String str)
c) Button(String str, Boolean state);
d) None of above
15) Which method is used to hide characters in TextField
a) Hide(char)
b) hideChar(char)
c) setEchoChar(char)
d) setEcho(char)

16) TextField is a______


a) single line edit control
b) multi line edit control
c) not a Component
d) is a Container

17) Default layout set to panel is ____


a) FlowLayput
b) BorderLayout
c) GridBagLayout
d) CardLayout

18) Default layout set to Frame is____


a) FlowLayput
b) BorderLayout
c) GridBagLayout
d) CardLayout

19) AWT components are ________


a) Heavy Weighted
b) Light Weighted

20) Dialog box having which of the following constructor


a) DiaolgBox(Parent Frame)
b) DialogBox()
c) Dialog(Parent Frame)
d) Dialog()

21) Multiline edit control is called as_____


a) Button
b) TextField
c) TextArea
d) List
22) Which of the following is parent class of AWT hierarchy
a) Container
b) Component
c) Button
d) Label

23) Can we select multiple options from Choice


a) Yes
b) No
c) Sometimes
d) Every time

24) Frame does not contain Title bar


a) true
b) false

25) Which of the following method makes TextField in only read mode
a) setEditable()
b) setReadMode()
c) setRead()
d) setReadModeOn()

26) Which of the following is correct value for FileDialog in AWT


a) FileDialog.OPEN
b) FileDialog.CLOSE
c) FileDialog.LOAD
d) FileDialog.EDIT

30) Applet contain MenuBar


a) True
b) False

31) Menu is derived from________


a) MenuBar
b) JMenuBar
c) MenuItem
d) Component
32) Default value of setVisible() method
a) True
b) False
c) Wrong method name
d) None of the above
33) Which of the following is orientation for style argument of ScrollBar
a)ScrollBar.VERTICAL
b)ScrollBar.HORIZONTAL
c)Both a and b
d)ScrollBar.CROSS

34) FlowLayout gives ___unit of space between two components.


a)10
b)7
c)5
d)0

35)Which of the following layout follows region


a)FlowLayout
b)CardLayout
c)BorderLayout
d)GridLayout

36) Which of the following Layout show only one visible component at a time
a)CardLayout
b)BorderLayout
c)GridBagLayout
d)FlowLayout

37) Which of the following layout arrange Components in row and column Format
a) BorderLayout
b)CardLayout
c) FlowLayout
d)GridLayout

38) Which is helper class of GridBagLayout


a)GridBagClass
b)GridBagHelper
c)GridBagLayoutHelper
d)GridBagConstraints

39)Awt components are light weighted


a)true
b)false

40)MenuItem is derived from Menu


a)true
b)false
41)MenuBar can contain______ number of Menu
a)only 1
b)Multiple
c)2
d)0

You might also like