-
Applet
Hey I want to place a Oval at random locations in the applet
I tried using the following logic but it is not placing the oval at different locations instead it is getting repainted at the same place
Can anybody out there has a solution .........Here is the code
public void mouseMoved(MouseEvent me){
showStatus("Mouse moving at "+me.getX()+ "'" +me.getY());
int rx =10*(int) Math.random();
int ry =10*(int)Math.random();
mouseX = (me.getX())*rx;
mouseY = (me.getY())*ry;
public void paint(Graphics g){
g.drawString(msg,mouseX,mouseY);
g.setColor(Color.blue);
g.fillOval(mouseX,mouseY,20,30);
}
Neti
-
any takers here?????????????
-
i think you might need an action listner for when the mouse moves
-
action listerner does not capture mouse events
I have another problem when I am changing a string value in applet it not displaying the new value it is still using the old value
any help out there
Neti
-
-
Hey I got it!! Solution is I need to restart browser instaed of reloading or refreshing
-
Woah, thats strange, but, whatever works :):P