-
Notifications
You must be signed in to change notification settings - Fork 0
/
P6.java
48 lines (36 loc) · 883 Bytes
/
P6.java
1
2
3
4
5
6
7
8
9
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
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class P6 extends Applet implements MouseListener {
String str;
public void init()
{
addMouseListener(this);
}
public void paint(Graphics G)
{
G.drawString(str, 20,20);
}
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e)
{
str= "mousePressed Method Called!";
repaint();
}
@Override
public void mouseReleased(MouseEvent e) {
str = "mouseReleased Method Called!";
repaint();
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
}