package class10_2_FakeSwingUtilties_CommandPattern;// Dr. Yoder. MSOE. 14 February 2017 public class ClientDriver { public static void main(String[] args) { FakeEventDispatchThread fakeSwing = FakeEventDispatchThread.getInstance(); fakeSwing.start(); while(true) { // Works by giving a command to be invoked // on the event dispatch thread FakeSwingUtilities.invokeLater( ()->fakeSwing.addNumber(10)); // Fails because no one else locks on fakeSwing // synchronized (fakeSwing) { // FakeSwingUtilities.invokeLater( // () -> fakeSwing.addNumber(10)); // } } } }