TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Java - Mouse Event Program Using Applet
Senthilvelan Sambamoorthy
Aug 20
2016
Code
22.8
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
mou.rar
/* using mouse event */
import
java.awt.*;
import
java.applet.*;
import
java.awt.event.*;
public
class
mou
extends
Applet
implements
MouseListener,MouseMotionListener
{
public
void
init()
{
addMouseListener(
this
);
addMouseMotionListener(
this
);
}
public
void
mouseClicked(MouseEvent e)
{
showStatus(
"mouse clicked : "
+e.getX()+
","
+e.getY());
}
public
void
mouseEntered(MouseEvent e)
{
showStatus(
"mouse entered : "
+e.getX()+
","
+e.getY());
for
(
int
i=
0
;i<
100000
;i++);
}
public
void
mouseExited(MouseEvent e)
{
showStatus(
"mouse exited : "
+e.getX()+
","
+e.getY());
}
public
void
mousePressed(MouseEvent e)
{
showStatus(
"mouse pressed : "
+e.getX()+
","
+e.getY());
}
public
void
mouseReleased(MouseEvent e)
{
showStatus(
"mouse released : "
+e.getX()+
","
+e.getY());
}
public
void
mouseMoved(MouseEvent e)
{
showStatus(
"mouse moved : "
+e.getX()+
","
+e.getY());
}
public
void
mouseDragged(MouseEvent e)
{
showStatus(
"mouse dragged : "
+e.getX()+
","
+e.getY());
}
}
/* <body>
<applet code = "mou.class" height = 200 width=200>
</applet>
</body> */
Java
Mouse Event Program using Applet