Java tutorial
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { /** * Opens Swing dialog * @param dialog the dialog to open */ public static void openDialog(final JDialog dialog) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { dialog.setVisible(true); } }); } }