Start the JWM application, blocking until completion. User init should be handled inside the `launcher` callback (on the main thread). This method must be the first method called in the JWM library. After this method call, library API can be safely accessed for creating wind
(@NotNull Runnable launcher)
| 23 | * <p>After this method call, library API can be safely accessed for creating windows and querying system info.</p> |
| 24 | */ |
| 25 | public static void start(@NotNull Runnable launcher) { |
| 26 | Library.load(); |
| 27 | ClassLoader cl = Thread.currentThread().getContextClassLoader(); |
| 28 | _nStart(() -> { |
| 29 | Thread t = Thread.currentThread(); |
| 30 | t.setContextClassLoader(cl); |
| 31 | _uiThreadId = t.getId(); |
| 32 | Log.setVerbose("true".equals(System.getenv("JWM_VERBOSE"))); |
| 33 | long t0 = System.currentTimeMillis(); |
| 34 | Log.setLogger((s) -> System.out.println("[ " + (System.currentTimeMillis() - t0) + " ] " + s)); |
| 35 | launcher.run(); |
| 36 | }); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * <p>Make new native platform-specific window.</p> |