S
Sanny
I was using mousedown() As Below.
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public boolean mouseDown(Event evt, int x,int y){
----- OLD CODE
----- OLD CODE
return true;
}
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Above code works correctly. Now I found somewhere mousedown is
depriciated. And I thought of changingf to
processMouseEvent() fiunction
I used below Code. And replace mousedown() by
processMouseEvent(MouseEvent event)
NEW CODE
---------------
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public void processMouseEvent(MouseEvent event) {
int x=event.getX();
int y=event.getY();
----- OLD CODE
----- OLD CODE
super.processMouseEvent( event );
}
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The new code do not give any compilation error. But when I start the
Applet the mousedown is not working.
Q 1. Do I have to add something more to use mouse pressed events?
Q 2. What is the benefit of using processMouseEvent() instead of
mousedown()?
Bye
Sanny
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public boolean mouseDown(Event evt, int x,int y){
----- OLD CODE
----- OLD CODE
return true;
}
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Above code works correctly. Now I found somewhere mousedown is
depriciated. And I thought of changingf to
processMouseEvent() fiunction
I used below Code. And replace mousedown() by
processMouseEvent(MouseEvent event)
NEW CODE
---------------
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public void processMouseEvent(MouseEvent event) {
int x=event.getX();
int y=event.getY();
----- OLD CODE
----- OLD CODE
super.processMouseEvent( event );
}
----------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The new code do not give any compilation error. But when I start the
Applet the mousedown is not working.
Q 1. Do I have to add something more to use mouse pressed events?
Q 2. What is the benefit of using processMouseEvent() instead of
mousedown()?
Bye
Sanny