import java.util.*; public class SecondTester implements Runnable { private Timer secondTimer; private int secondCounter; private boolean switcher = false; public boolean simRunner = true; private int count = 0; public SecondTester() { secondTimer = new Timer(); } public void run() { System.out.println("Hello from another thread!"); SecondTester sT = new SecondTester(); secondTimer.schedule(new secondTimer(), 0, 500); } class secondTimer extends TimerTask { public void run() { if (simRunner == true) { for (int i=0; i< 100; i++) { System.out.println(); } if (switcher == false) { System.out.println("'o."); System.out.println(".o'"); System.out.println("'o."); System.out.println(".o'"); System.out.println("'o."); System.out.println(".o'"); switcher = true; System.out.println("Press enter!"); } else if (switcher == true) { System.out.println(".o'"); System.out.println("'o."); System.out.println(".o'"); System.out.println("'o."); System.out.println(".o'"); System.out.println("'o."); switcher = false; System.out.println("Press enter!"); } } count++; if (count == 20) { System.exit(0); } } } public static void main(String args[]) { } public void runnerFalse() { simRunner = false; } }