private void delay(int sec){ try { Thread.currentThread().sleep(1000*sec); } catch (InterruptedException e) { e.printStackTrace(); } }