Java Swing; Two classes, where to put if statements and new actionlisteners?
Because ClockListener is a nested class (lower), the enclosing instance (upper) can access the listener’s private fields. If you have a reference to an instance of ClockListener, ClockListener cl = new ClockListener(); you can use it to initialize your timer Timer t = new Timer(1000, cl); and you can use it in your test: if … Read more