adri3d
(usa Arch Linux)
Enviado em 21/01/2012 - 11:45h
chame esse metodo passando o jframe, na hora da falha de autenticação
public void shake (javax.swing.JFrame jframe){
try{
int originalX = jframe.getLocation().x;
int originalY = jframe.getLocation().y;
long sleepTime = 30;
for(int i =0; i <=2 ; i++){
jframe.setLocation(originalX + 5, originalY);
Thread.sleep(sleepTime);
jframe.setLocation(originalX+ 5, originalY +5);
Thread.sleep(sleepTime);
jframe.setLocation(originalX, originalY + 5);
Thread.sleep(sleepTime);
jframe.setLocation(originalX, originalY);
Thread.sleep(sleepTime);
jframe.setLocation(originalX - 5, originalY);
Thread.sleep(sleepTime);
jframe.setLocation(originalX - 5, originalY -5);
Thread.sleep(sleepTime);
jframe.setLocation(originalX, originalY - 5);
Thread.sleep(sleepTime);
}
jframe.setLocation(originalX, originalY);
} catch(Exception ex){
System.out.println(ex.toString());
}
}