Q. N.
6
7
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Computer Engineering De
Course: Advanced Java Programming Code: 22517
Unit I : Introduction to AW
Question
Which of the following class is derived from the container class
Name of the class used to represent a GUI application window,which is
optionally resizable and can have a title bar,an icon,and menus
Which abstract class is the super class of all menu related classes ?
Which of these classes can be added to a Frame component?
Which class can be used to represent a checkbox with a textual lable that can
appear in a menu?
Which of these classes can be added to any Container class,using the add
method defined in container class?
Package of drawstring() method is
Which method exectes only once?
All collection classes are available in
Thread class is available in
Minimum threads in a program are
JIT meaning
program which executes applet is known as
In main() method,data type of parameter is
How many keywords(approximately)are available in java ?(May vary from
version to version)
Smallest individual unit in java program is know as
What does AWT stands for?
which of the following statements about GUI components is wrong
What do you means by javap?
JVM is a _______________for byte code.
In applet,which of the following is used for accepting user defined parameter
What is runnable from following
Which of the following applet class displays the result of the applet code on
the screen ?
On which side applet always executed?
Which of the following file is Applet document ?
What is another name for java intermediate code ?
Which stage Language java is Know as?
Which KeyWord is used to implement interface in the class?
In java,gc() (i.e. garbage collector) method is available is which pakage?
Vector class is available in
Which of the following terms are included inside the package?
Is it possible to write nested try?
Which method cannot be overridden?
In which pacakge thread class is available?
which method executes only once?
What is jdb?
Is it possible to declare method of the interface as private?
Why we need to write static keyword to main method?
All methods of the interface are public & abstract
If a class contains one or more abstarct methods then it is declared as
Which of the following command is used to compile java program?
Is it possible to create object of interface ?
When applet is dead,it automatically invokes the_____ method when we quit
the browser
In which process we create exact copy of the existing object?
API stand for_______
If a program consists of three classes then after compilation how many class
file are created by compiler?
Executable applet is nothing but _____ file of the applet
In which package ,exception class is available?
Arguments passed via command line are stored as _____ data type
A GUI______
An object is composed of:
Which is a component in AWT that can contain another component like
buttons ,textfields,labels etc?
The swing component classes that are used in encpasulate a mutully
exclusive set of buttons?
The following way is used to create a frame by creating the object of frame
class?
Which of the following is used to interpret and execute Java Applet Claases
hosted by HTML?
which of the following is not keyword in java?
which of the following is not keyword in java?
The realtionship between a parent class and a child class is referred to as a
_______ realationship
Java applets are used to create _______ application
A push button is an active control that has a ________ appearacnce
The various controls supported by AWT are:
Which of the following are subclasses of java.awt.component?
Which of the following statements is for placing the frame's upper left corner
to (200,100)
Suppose a Jframe uses the GridLayout(2,0). If you add the six buttons to the
frame, how many columns are displayed?
The default layout out of a Jpanel is _____________
___________ creates a color object.
Which color is the darkest?
The method___________sets the font (Helvetica,20-point bold) in
component C.
Can you use the setBackground method to set a back ground color
for_________?
You can use methods_______ on any instance of java.awt.Component.
_______ can be used to enter or display a string
Which of the following statements about are true ?
Which of the following statements about GUI components is wrong ?
Swing components that don't rely on native GUI are referred to as
_______________
What is best to describe the relationship between Jcomponent and Jbutton?
Which component cannot be added to a container?
To add a component c to a Jpanel p,use___________.
The method ____________ sets the foreground color to yellow in Jframe f.
To create a Jpanel of the BorderLayout,use_______
The default layout out of a contentpanel in a Jframe is________________.
Which color is the darkest?
________ checks whether the Jcheckbox is selected.
The method _______ gets the the text (or caption) of the jlbl.
The method_____assigns the name Result to the text of variable jlbl.
The method ________ gets the contents of the text field jtf
pacakage contains all the classes and methods required for event handling in
java
method are used to register a keyboard event listener
method are used to register a mouse motion listener
In which library event class is defined?
which of these methods can be used to determine the typeof event?
is superclass of all the events
If scroll bar is manipulated -------- event will be notified
if we close an applet 's window---------- event will be generated
Which of these event is generated when a button is pressed?
method can be used to obtain the command name for invoking ActionEvent
object
which of these integer constant defined in ActionEvent class?
which of these events is generated by scroll bar?
method can be used to determine the type of adjustment event
method can be used to know the degree of adjustment made by the user
If scroll bar is manipulated -------- event will be notified
which of these constant value will change when the button at the end of scroll bar was
clicked toincrease its value?
When the size of component is changed ,-------event is generated?
When the component is added or removed ? Which of these event is generated ?
method can be used to obtain the reference to the container that generated a
ConatainerEvent
Which of the following methods can be used get reference to a component that was
affected by the container?
which of the following is/are integer constant of ComponentEvent class?
event is generated when computer gains or losses input focus
FocusEvent is subclassof which of these classes?
can be used to know the type of focus change
is superclass of ContainerEvent class
Which of the following method can be used to obtain the coordinate of mouse?
method can be used to change location of an event
Which of the following is integer constant of TextEvent class?
is used to obtain the object that generated a WindowEvent
MouseEvent is subclass of which of these class?
method is used to get X coordinates of the mouse
which of these are constants defined in WindowEvent class?
is a superclass of WindowEvent class
which of these package conatins all the event handling interfaces?
when a componenet is added to a container which of these interfaces handels the event?
interface define a method actionPerformed()
which of the following intertface define four methods?
interface define a method itemStateChanged()
which method from the following methods will respond when you click any button by
mouse?
methods will be invoked if a character is entered
method is define in MouseMotionAdapter class
which of the constant from the following constants is defined in WindowEvent class?
is a superclass of all adapter classes
In java,events are all theactivities that occur between:
EventObject class belong to:
The component class is an abstract class and so its ------------ are used to create
components
The AWT classes can be roughly categorized into the following groups:
Window is is used for ------------------ windows.
The ------------ interface is used to handle the menu events
The name of the event classes are:
java packages such as ----------- support the Event handling mechanism
An event is generated when the internal state of the event source is ---------
Eventobject class belongs to;
The --------interface handles list events
The ---------interface is used to handel the menu events
Which of the following components generate action events ?
The event delegation model ,introduced in release 1.1 of the JDK , is fully compatible
with the event model
neering Department
Course Faculty: I. J. Patel
oduction to AWT
Option A Option-B Option-C Option-D
Component Panel MenuComponent List
Window Panel Dialog Frame
CheckboxMe
MenuComponent MenuBar MenuItem nuItem
Menu Button Window Applet
CheckBoxMenuIta
MenuBar m Menu Menubar
CheckBoxMenuIta
Button m Menu Menubar
java.applet java.io javax.swing java.awt
destroy()met
start()method init()method stop()method hod
java. unit
java.io Package java.lang packege java.awt package pakage
java. unit
java.io Package java.lang packege java.awt package pakage
1 2 5 Many
none of
Java In Time Just In Time Join In time above
none of
Applet Engine Virtual machine JVM above
int char String double
32 39 48 115
String Literal Token Operator
Abstract Window Abstract Writing All Window
All Writing Tool Toolkit ToolKit Tool
you cannot
placeAWT AWT stands for The AWT
Swing exists since components on Abstract classes are
version 1.2. of jdk swing containers Window Toolkit deprecated
java
Java disassembler java interpreter java compiler debugger
Interpreter Disassemble Compiler Debugger
Body Center Applet Param
Class Method Interface variable
paint() void() string() getKey()
Serverside Client side
Html Java Text Doc
None of the
java code Byte code Refernce Code above
Zero Two Four Eight
implements implement Interface Extends
Java.lang java.io java.util java.awt
java.io Package java.io java.util java.awt
All of the
Class Methods Interfaces Above
yes No
println printf scanf final
Java.util Java.io Java.lang Java.awt
start() init() stop() destroy()
java
java debugger java intrepreter java compiler disassemable
yes no
it gives access to other to create single none of the
methods it is in syntax copy above
TRUE FALSE
Any of the
final static abstract above
Java Javap Javaq Javac
yes no
Paint() stop() destroy() Final()
Overriding Overloading Cloning Cloping
Application Application Advance
Programming Programming programming None of the
Infrastracture Interface Interface above
Single three uncountable zero
.txt .java .class .html
java.lang java.util java.io java.awt
argument double be easy
should string for
stands integer
uses button,menus & for a user to Graphic Use
icons manipulate Intraction Both (a)&(b)
All of the
Properties Methods Events Above
Window Container Panel Frame
AbstarctButton ButtonGroup JButton ImageIcon
None of the
Inheritance Association Both (s) & (b) above
AppletViewer Appletscreen Appeltwatcher Appeltshow
Abstarct Finalize Assert Boolean
Strictfp Transient Instanceof enum
is-a was-a has-a instance-of
none of the
graphical user intreactive Both (a) & (b) above
Three none of the
One dimensional Two dimensional dimensional above
CheckBoxes,choic Scroll bars, text
Labels,push buttons e list fields,text area All of these
Helper classes
user interface Layout
Container classes such as Color
classes managers
and Font
frame.setLocation(100, frame.setLoc
frame.setLocation frame.setLocatio
100) ation(200,20
(100,200) n(200,100)
0)
1 2 3 4
flowlayout Gridlayout Borderlayout None
newColour(0,266, newColour(255,2 newColour(1
new Colour(0,0,0)
0) 55,255) ,2,3)
newColor(30
new Colour(0,0,0) newColor(10,0,0) newColor(20,0,0)
,0,0)
c.setFont(ne
c.setfont(newfont c.setFont(font("h
c.setFont("helvetica",fo w
("helvetica",BOLD, elvetica",font.BO
nt.bold,20)) Font("helveti
20)) LD,20))
ca",Font.BOL
Component Container Jcomponent Jbutton
setBackground getBackground getBorder getHeight
A label A button A check box
textfield
To distinguish new All Swing GUI A user interface A container
Swing component components are object such as such as
classes are named with lightweight. (button, list) can Jframe is
You can not
AWT stands for The AWT
Swing exists since place AWT
Abstract classes are
version 1,2 of the jdk components on
Window Toolkit deprecated
swing containers
Lightweight GUI non-GUI
Heavyweight
components components components
components
Association
Aggregation Composition Inhertitance
JPanel
Jbutton Jframe Jcomponent
p.getContentPane
p.add(c) p.insert(c) p.append(c)
l(c)
setForegroun
setForeground(Color.Ye f.setForeground(C f.setForeground(
d(Color.Yello
llow) olor.yellow) Color.yellow)
w)
Jpanel p=new Jpanel p=new Jpanel
Jpanel p=new Jpnel() Jpanel(Border Jpanel(new p=new
Layout)); BorderLayout)); Jpanel().setL
flowlayout Gridlayout Borderlayout None
newColor(30
new Colour(0,0,0) newColor(10,0,0) newColor(20,0,0)
,0,0)
jchk.getSelected() jchk.selected() jchk.isSelected() jchk.select()
jlbl.retrieveT
jlbl.Text() jlbl.getText() jlbl.findText()
ext()
jlbl.newText("Res
jlbl.setText("Result") jlbl.Text() jlbl.findText()
ult")
jtf.getText(s) jtf.get.Text() jtf.getString() jtf.getString()
java.applet java.awt java.event java.awt.event
eventKeyboard
KeyListener() addKistener() addKeyListener() Listener
addMouseMotionLis eventMouseMo
addMouse() addMouseListener() tner() tionListener()
java.io java.util java.lang java.net
getSource() getEvent() getID() getEventObject()
EventObject EventClass ActionEvent ItemEvent
ActionEvent ComponentEvent AdjustmentEvent WindowEvent
ActionEvent ComponentEvent AdjustmentEvent WindowEvent
ActionEvent KeyEvent WindowEvent AdjustmentEvent
getActionEvent
getCommand() getActionCommand() getActionEvent() Command()
All of the
ALT_MASK CTRL-MASK SHIFT-MASK mentioned
ActionEvent AdjustmentEvent KeyEvent WindowEvent
getAdjustmentType( getEventObject
getType() getEventType() ) Type()
getAdjustmentValue getAdjustment
getValue() getAdjustmentType() () Amount()
ActionEvent ComponentEvent AdjustmentEvent WindowEvent
BLOCK_INCREME UNIT_DECREME UNIT_INCRE
BLOCK_DECREMENT NT NT MENT
ComponentEvent ContainerEvent FocusEvent InputEvent
ComponentEvent ContainerEvent FocusEvent InputEvent
getContainerComma getConatainerE
getContainer() nd() getActionEvent() vent()
getContainerCompo getcComponent
getComponent() getChild() nent() Child()
COMPONENT_MO COMPONENT_RE All of the
COMPONENT-HIDDEN VED SIZE mentioned
ComponentEvent ContainerEvent FocusEvent InputEvent
ComponentEvent ContainerEvent ItemEvent InputEvent
typeFocus() typeEventFocus() isTemporary() isPermanent()
WindowEvent() ComponentEvent ItemEvent InputEvent
getMouseCoor
getPoint() getCoordinates() getMouseXY() dinates()
ChangeCoordinates( TranslateCordi
ChangePoint() TranslatPoint() ) nates()
TEXT_FORMAT_C TEXT_VALUE_CH TEXT_SIZE_C
TEXT_CHANGED HANGED ANGED HANGED
getWindowObj
getMethod() getWindow() getWindowEvent() ect()
ComponentEvent ContainerEvent ItemEvent InputEvent
getX() getXCoordinates() getCoordinateX() getPointX()
WINDOW_DEIICO All of the
WINDOW_ACTIVATED WINDOW_CLOSED NFIED mentioned
WindowEvent() ComponentEvent ItemEvent InputEvent
java.lang java.awt java.awt.event java.event
ComponentListener ConatinerListener FocusListener InputListener
ComponentListener ConatinerListener ActioListener InputListener
ComponentListener ConatinerListener ActioListener InputListener
ComponentListener ConatinerListener ActioListener ItemListener
All of the
mouseClicked() mouseEntered() mousePressed() mentioned
keyPressed() keyReleased() keyTyped()keyEntered()
mouseClicked(
mouseDragged() mousePressed() mouseReleased() )
WINDOW_CLOSE WINDOW_DEIICO All of the
WINDOW_ACTIVATED D NFIED mentioned
Applet ComponentEvent Event InputEvent
The user The application Both (a) & (b) None of the above
java.util java.awt java.lang java.sql
Subclasses Superclasses Both (a) & (b) none of these
GUI components Layouts Graphics tools All of these
creating handling modifying Both (a) & (b)
ContainerListener FocusListener ActionListener WindowLisenter
ActionEvent,ComponentEv ConatinerEvent,Focu
ent sEvent ItemEvent,KeyEvent All of these
Java.util Java.awt Java.awt.event All of these
Not changed Changed Either change or not none of these
Java.util Java.awt Java.awt.event java.sql
ConatinerListener ItemListener FocusListener ActionListener
ConatinerListener ItemListener ActionListener WindowListener
Buttons Labels Check box Windows
TRUE FALSE
ntObject()
mentEvent
of the above
wLisenter
wListener