Chapter 3 MCQ 1 ajp
Chapter 3 MCQ 1 ajp
Student Name : KAPADIA KUSH AMIT Roll No. : 20203A0055 Enrollment No.
: 2005680051
2 a) addMouse() b) addMouseListener() c d 0
d)
c) addMouseMotionListner()
eventMouseMotionListener()
b)
3 a a 1
a) windowIconfified()
windowClosed()
c) d)
windowDeactivated() windowOpened()
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 1/8
10/12/22, 8:29 PM Vidyalankar Polytechnic | VP
addKeyListener(this);
requestFocus();
showStatus("Key Down");
showStatus("Key Up");
msg += ke.getKeyChar();
repaint(); }
g.drawString(msg, X, Y);
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 2/8
10/12/22, 8:29 PM Vidyalankar Polytechnic | VP
Missing } Missing()
a) b)
5 a a 1
Button Label
c) d)
CheckBox Window
7 d a 0
a) getPoint() b) getCoordinates()
c)
d) getMouseCordinates()
getMouseXY()
8 b b 1
a) windowActivated b) windowReactivated
d)
c) windowDeiconified
windowClosed()
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 3/8
10/12/22, 8:29 PM Vidyalankar Polytechnic | VP
a) b)
10 a a 1
adapter classes Event
c) d)
EventObject Listener
12 a) java.util.EventListener b) java.util.EventObject c b 0
c)
d) java.awt.event.AWTEvent
java.awt.AWTEvent
13 c c 1
a) Exception Handling b) String Handling
d)
c) Event Handling
None of the above
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 4/8
10/12/22, 8:29 PM Vidyalankar Polytechnic | VP
a) changePoint() b)
14 a b 0
translatePoint()
c)
d) translateCordinates()
changeCordinates()
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
Container c=getContentPane();
c.setLayout(new FlowLayout());
b1.addActionListener(this);
c.add(b1);
b2.addActionListener(this);
c.add(b2);
b3.addActionListener(this);
c.add(b3);
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 5/8
10/12/22, 8:29 PM Vidyalankar Polytechnic | VP
bg.add(b1);
bg.add(b2);
bg.add(b3);
String str;
str=e.getActionCommand();
if(str=="red")
c.setBackground(Color.red);
else if(str=="blue")
c.setBackground(Color.blue);
else if(str=="green")
c.setBackground(Color.green);
/**/
b) ActionListener
a) ItemListener
d)
c) MouseListener
WindowListener
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 6/8
10/12/22, 8:29 PM Vidyalankar Polytechnic | VP
a) event
16 b) Source a a 1
c) d)
17 c c 1
a) KeyListener() b) addListener()
d)
c) addKeyListener()
eventKeyboardListener()
a) b)
18 b c 0
getParent() getComponent()
c) d)
getChild() geoReferenced()
Which of these methods will respond when you click any button
by mouse?
a) mouseClicked() b) mouseEntered()
19 a d 0
c)
d)
mousePressed()
All of the above
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 7/8
10/12/22, 8:29 PM Vidyalankar Polytechnic | VP
void
addTreeExpansionListener(___________________________ tel)
20 b b 1
a) TreeExpansionlistener b) TreeExpansionListener
d)
c) TreeListener
treeListener
Total Marks : 20
Obtained : 12
https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 8/8