Here you can find the source of setWinVisible(final JDialog win, final boolean vis)
public static void setWinVisible(final JDialog win, final boolean vis)
//package com.java2s; //License from project: Open Source License import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.SwingUtilities; public class Main { public static void setWinVisible(final JFrame win, final boolean vis) { SwingUtilities.invokeLater(new Runnable() { public void run() { win.setVisible(vis);/* w ww.j ava2s.com*/ } }); } public static void setWinVisible(final JDialog win, final boolean vis) { SwingUtilities.invokeLater(new Runnable() { public void run() { win.setVisible(vis); } }); } }