EventQueue.invokeLater(Runnable runnable) has the following syntax.
public static void invokeLater(Runnable runnable)
In the following code shows how to use EventQueue.invokeLater(Runnable runnable) method.
/* www . j av a2s . c o m*/ import java.awt.EventQueue; import javax.swing.JFrame; public class Main { public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { JFrame frame = new ImageProcessingFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }); } } class ImageProcessingFrame extends JFrame { public ImageProcessingFrame() { setTitle("ImageProcessingTest"); setSize(200, 200); } }