0% found this document useful (0 votes)
33 views1 page

Ajp MCQ QB CT 1 Set 2

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

Ajp MCQ QB CT 1 Set 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd

Q.

N Question
1.Which is correct method for adding button component into North region of border A B
b) C
c) add(b1, D
d) Ans
c) add(b1,
a) b1.add(BL,
1 layout? Assume b1 as button object and BL as layout object. add(b1.NOR BorderLayout b1.add(NOR BorderLayout
NORTH) CheckBoxMe CheckBoxMe CheckBoxMe CheckBoxMe
CheckBoxMe
2 2.Which constructor creates a checkable menu item with initially checked? TH) .NORTH) TH) .NORTH)
nuItem() nuItem(String nuItem(String nuItem(String nuItem(String
3 3.Which containers use FlowLayout as default layout? a) Dialog b) Applet c) Frame d) None b) Applet
a) Text(non- b) Text c) Botha a a) Text(non-
4 4.What a Label component display? d) None
editable
a) ) (editable)
b) andc) b editable
c) )
5 5.Which of the following layout managers need to create a Panel? b) d)NullLayout
FlowLayout GridLayout CardLayout CardLayout
6 6.Which of the following is not event source? a) MenuItem CheckboxGro
b) Using c)c)Using
List d) Label
d)Using d) Label
getActionCo up getActionCo
7 7. How to obtain the command name for invoking ActionEvent? getCommand getAction( ) obtainAction(
mmand( ) c)CheckboxG mmand( )
8 8.Which of the following component handles both Action and Item Event? a) Button
a) b)( )Checkbox
method.
b) method.
c) ) method.
d)List
d) d)List
d)
roup
9 9.ItemListener event defines this method… itemEventCh itemEventOc itemValueCh itemStateCha itemStateCha
a) new b) new c) new d)new b) new
10 10.Which of the following creates a List with 3 visible items and multiple mode select anged( ) cured() anged() nged() nged()
List(3,false)
a) keyPressed List(3,true)
b) List(false,3) List(true,3)
d) All of List(3,true)
11 11. Which of the following event of KeyEvent class is generated when a character is p c) keyTyped
c) c) keyTyped
keyReleased above
12 12.Which of these is superclass of all Adapter classes? a) Applet b) Event ComponentE d) InputEvent a) Applet
public class A1 extends Applet vent
13 Label l1 void
= new Label(“1”); a) (1,1) b) (0,0) c)c)Label
(2,2) is d)d)Label(3,3)is a) (1,1)
{ public init() a) Blank b) Label is b) Label is
14 add(l1); } } added at added at
output added at Left c) addedc)at Left
15 15.Which class defines the setSize( ) method ? a) Frame b) Applet Right Center
d) Panel
Component Component
16 16. Which class encapsulates a blank window upon which we can draw? a) Applet b) Canvas c)Window d)Panel b) Canvas
a) a)
17 17.Which method we use if we want to hide the window? a) b) SetHide() c)show() d) hide() a)
setVisible() b)Font.BOL c)Font.PLAI d)Font.ITALI setVisible()
18 18.Which of the following style is not supported by Font class? Font.UNDER d) Font.UNDER
d)
a) D
b) N C
19 19.Which alignment is not supported by Label? LINE c)Label.CEN Label.BASE Label.BASE LINE
Label.RIGHT Label.LEFT
20 20. What is default block-increment of Scrollbar? a) 10 is an b) 5
object is aTERc)1
method is aLINE
d)2
variable is a)LINE
an 10
object
variable that
21 21. What is a listener in the context to event handling? a) when that notified that notified that notified
d) that notified
a)
notified b) c)
22 22. Which of these methods are used to register keyboard event listener? addKeyListen whenb)event whenc)event eventKeyboar when event addKeyListen
whenc)event
a) KeyListener() addKistener() d)getEventOb
23 23. Which of these methods are used to determine the type of adjustment event? er() getEventType
b) getAdjustmen
c) dListener()
d) er()
getAdjustmen
getType()
a) jectType() a)
24 24. Which of these methods can be used to obtain the coordinates of a mouse? ()
getCoordinat tType()
getMouseXY getMouseCoo tType()
getPoint() b) c) d)getEventOb getPoint()
25 {25. Which
public of paint(Graphics
void these methods areg) used to determine the type of event? a) getID() es() () rdinates() a) getID()
getSource() getEvent()
b)Compilatio c)Runtime d)None ject()
of the b)Compilatio
26 { g.drawString(“Hello”); } }
t1.setText(""Hi""); a)a)Hello
Hi is b)No
n Error Error
c)Blank above nb)No
Error
27 } }
l1.setText(""Hello""); printed in message is d)Error message is
a)add(l1), Output d)None of the d)None of the
28 } } ); } textfield printed
b)add(l1,b1) c)add(b1,l1) printed
add(b1); above
a)Window is not visible c)Window is not visible a)Window is above
29 }g.drawString(""Hello"",100,100); displayed
fontclosed
size is and notand deactivated
font size is
displayed
and notand displayedclosed and
30 } }} yellow
increased color font size is
by with yellow increasedmagentaby font size is font
yellow size is
color
increased by with magenta
increased by increased
31 and after color and and afterby
color initial c) color initial
32 32. Which method is used to apply Label on Button? clicking the b)setLabel()
a) setText() b) after clicking clicking the
b)setLabel()
setString()
c) d)setValue()
d) c)
33 33. Frame uses by default ________________Layout a)GridLayout GridBagLayo
BorderLayout FlowLayout BorderLayout
34 34. Which Component of AWT provides a compact, multi choice, scrolling selection? a)List ut
b)b)Choice
void c)
c) Panel
void d) TextArea
d) char a)List
c) void
a)void
35 35.Which method of TextField class is used to create a password field? setEditable(b setEchoChar( getEchoChar(
Font(char setEchoChar(
setText()
name, int fontstyle,int
36 36.Identify the correct constructor of Font class? oolean c) fontstyle,Stri
char ch) name, ) int name,
char ch)int
fontstyle, int pointsize,Stri ng name,int fontstyle, int
37 37.BorderLayout class has __________regions to add components to it a)two b)b)
Six c) Four fontstyle,int
d) Five d) Five
a)Menuitem( menuitem(Str MenuItem(St MenuItem(St
38 38.Identify which is a valid constructor of MenuItem class? a) Menuitem(int a)
) ing ring
d) ring
39 39.In Swing Buttons are the subclasses of which class? a) Scrollbar itemname
AbstractButto b) Jbutton) c) Button AbstractButto
n is b) Button is Checkbox JRadioButton
d) Mouse is b) Button n is
40 40.ActionEvent is generated when___________________ position
pressed item is moved pressed
manipulated

You might also like