y esto me pondria el puntero en cualquier parte del escritorio? aun estando fuera de un frame??... Y si queiro hacer doble click??
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menúimport java.awt.*;
import javax.swing.*;
class MiArco extends JFrame{
//int x=250,y=200;
final int fx=400,fy=400;
int x,y;
public MiArco(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(2000,2000);
setVisible(true);
}
public void m(){
int t=15;
for(int h=0;h<t;h++){
int auxx=t-h;
int auxy=auxx*auxx;
try{ Thread.sleep(15);}catch(Exception e){}
x=(fx-auxx*12);
y=(fy+auxx*auxx);
repaint();
}
try{ Thread.sleep(50);}catch(Exception e){}
for(int h=0;h<t;h++){
int auxx=h;
int auxy=auxx*auxx;
try{ Thread.sleep(15);}catch(Exception e){}
x=(fx+auxx*12);
y=(fy+auxx*auxx);
repaint();
}
}
public void paint(Graphics g){
try{
Thread.sleep(10);
}catch(Exception e){}
System.out.println("x"+x+"y"+y);
g.fillOval(x,y, 5,5);
}
public static void main(String arg[]){
MiArco mi=new MiArco();
try{ Thread.sleep(1000);}catch(Exception e){}
mi.m();
}
}