Java tutorial
import javax.swing.SwingUtilities; public class Main { public static void main(String[] args) { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { System.out.println("Hello World on " + Thread.currentThread()); } }); } catch (Exception e) { e.printStackTrace(); } System.out.println("Finished on " + Thread.currentThread()); } }