...
Tab dynamisch hinzufügen
Code Block language java theme Confluence Codeprivate void progressBar_attach(ClientConnector.AttachEvent event) { Runnable task = ()->{ for(int i=0; i<=100; i++) { float value = (float)i/100f; System.out.println(value); getUI().access(()->progressBar.setValue(value)); try { Thread.sleep(10); } catch (InterruptedException e) { } } }; new Thread(new RunnableAccessWrapper(task)).start(); } private void progressBar_attach(ClientConnector.AttachEvent event) { // Find out the value of the total progress. It is 1.0 // Starts a new thread Runnable task = ()->{ // Repeat until value is 1.0 // Find out the value of the current progress and convert into a float between 0.1 and 1.0 // Sets the value of the ProgressBar getUI().access(()->progressBar.setValue(value)); }; new Thread(new RunnableAccessWrapper(task)).start(); }