class PaintMonitor extends Thread { Slide shw, cur; Screen scn; PaintMonitor(Slide show, Screen screen) { this.shw = show; this.scn = screen; } public void run() { while (true) { try { wait(); } catch (Exception e){ p(e); } if (cur != null) { p("NEW FUCKING IMAGE"); p("Showing image: "+cur.img); scn.showImage(cur.img); try { p("Delaying "+cur.delay+" ms"); Thread.sleep(cur.delay); } catch (Exception x) { p(x); } cur = cur.next; } } } private void p(String s) { System.out.println(s); } private void p(Exception e) { System.out.println(e); } }