Skip to content

Instantly share code, notes, and snippets.

@0x000000AC
Created November 30, 2012 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 0x000000AC/4178447 to your computer and use it in GitHub Desktop.
Save 0x000000AC/4178447 to your computer and use it in GitHub Desktop.
Hello World using the JOptionPane
/***********************************************
* HelloGUI.java
* Aaron P. Clark
*
* One of the last programs of the chapter. Exhibits
* the use of the JOPtionPane GUI
***********************************************/
import javax.swing.JOptionPane;
public class HelloGUI
{
public static void main(String[] args)
{
JOptionPane.showMessageDialog(null, "Hello, World!");
}
}
@tresf
Copy link

tresf commented Feb 7, 2020

You should consider adding SwingUtilities.invokeAndWait() to ensure the call makes it on the Event Dispatch Thread.

https://gist.github.com/tresf/6e2f0fb8db69457ddc4e05a41b7c7c27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment