Skip to content

Instantly share code, notes, and snippets.

Created August 8, 2010 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/514573 to your computer and use it in GitHub Desktop.
Save anonymous/514573 to your computer and use it in GitHub Desktop.
/*
* Main.java
*
*/
package TestJavaClient;
import java.awt.Component;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
public class Main {
// This method is called to start the application
public static void main (String args[]) {
SampleFrame sampleFrame = new SampleFrame();
sampleFrame.setVisible(true);
}
static public void inform( final Component parent, final String str) {
if( SwingUtilities.isEventDispatchThread() ) {
showMsg( parent, str, JOptionPane.INFORMATION_MESSAGE);
}
else {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
showMsg( parent, str, JOptionPane.INFORMATION_MESSAGE);
}
});
}
}
static private void showMsg( Component parent, String str, int type) {
// this function pops up a dlg box displaying a message
JOptionPane.showMessageDialog( parent, str, "IB Java Test Client", type);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment