tags:

views:

31

answers:

3

I'm looking for a quick and dirty way in Java to flash up a message box to the user, to return when they click OK. It's for an application termination condition, so I'm really not interested in oh here's mah JFrame and all the rest of it. The MessageBox function in the Windows API is exactly what I want, except I'm stuck in Javaland. Any recommendations for similar functions?

Edit: Now that I come to think of it, how the hell do you exit a Java app? The only way I've ever managed to close mine is by making a JFrame and having EXIT_ON_CLOSE.

Edit: Got it.

+1  A: 

Dialogs

Rulmeq
A: 

Security issues makes your own dialog (not the system one) the best solution.

// edit
"own dialog" - I meant a dialog that runs in virtual machine

adf88
please write why -1
adf88
+3  A: 

You could use:

JOptionPane.showMessageDialog(null, "blah blah blah");

it shows a message box centered relative to the screen, with an 'ok' button

xdevel2000