115 return scene; 116 } 117 118 public static void startAndWaitShell() throws InterruptedException { 119 Semaphore shellWaiter = new Semaphore(0); 120 OtherThreadRunner.invokeOnMainThread(() -> { 121 Display display = new Display(); 122 Shell shell = new FXCanvasBrowserApp().shell; 123 shellWaiter.release(); 124 while (!shell.isDisposed() && OtherThreadRunner.isRunning()) { 125 if (!display.readAndDispatch()) { 126 display.sleep(); 127 } 128 } 129 display.dispose(); 130 }); 131 shellWaiter.acquire(); 132 } 133 134 public static void main(String[] args) { 135 System.setProperty("proxyHost", "www-proxy.ru.oracle.com"); 136 System.setProperty("proxyPort", "80"); 137 try { 138 startAndWaitShell(); 139 } catch (InterruptedException ex) { 140 System.err.printf("Failed to start SWT application: %s.\n", ex); 141 } 142 } 143 } | 115 return scene; 116 } 117 118 public static void startAndWaitShell() throws InterruptedException { 119 Semaphore shellWaiter = new Semaphore(0); 120 OtherThreadRunner.invokeOnMainThread(() -> { 121 Display display = new Display(); 122 Shell shell = new FXCanvasBrowserApp().shell; 123 shellWaiter.release(); 124 while (!shell.isDisposed() && OtherThreadRunner.isRunning()) { 125 if (!display.readAndDispatch()) { 126 display.sleep(); 127 } 128 } 129 display.dispose(); 130 }); 131 shellWaiter.acquire(); 132 } 133 134 public static void main(String[] args) { 135 try { 136 startAndWaitShell(); 137 } catch (InterruptedException ex) { 138 System.err.printf("Failed to start SWT application: %s.\n", ex); 139 } 140 } 141 } |