One possible solution--
JLabel m = new JLabel("Program has terminated");
JPanel p = new JPanel();
p.add(m);
JFrame f = new JFrame();
f.add(p);
f.pack();
f.setVisible(true);
I didn't compile/test this...but should give you and idea.
public class MyDialog extends JDialog {
public MyDialog(String message) {
super();
setSize(100, 100);
getContentPane().add(new JLabel(message));
show();
}
}
I don't know that this would work, but you can give it a try.
One of the constructors for JOptionPane takes as one of its arguments an array of Options that get translated into the buttons to appear on the dialog. It is possible that if you send it a 0 length array that no buttons will appear. It is also possible that it will throw an error. You'll have to try it and find out.