Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to display an message in a message box

0 views
Skip to first unread message

Steve Cocks

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
Hi

This is a really dump question I know but...

How the heck do I display a message in a message box with just an OK button
to dismiss it without having to build the dialog muself. Surely there is an
object either in Swing or AWT I can use but I can't seem tolocate one.

Failing this anybody willing to share some source code ?

Cheers
Steve

Olivier Fillon

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to
very easy once you know the swing class your are looking to is:
JOptionPane!!!
not this obvious a name!!!
example:
JOptionPane.showMessageDialog(null,"message","title",
JOptionPane.ERROR_MESSAGE);
sure it will help :)
Olivier

Steve Cocks wrote in message <72eu74$q...@newstoo.ericsson.se>...

Gordon Tillman

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to
Hi Folks,

Related question to Steve's:

>How the heck do I display a message in a message box with just an OK button
>to dismiss it without having to build the dialog muself. Surely there is an
>object either in Swing or AWT I can use but I can't seem tolocate one.


Has anyone had problems with the buttons that JOptionPane displays? In
particular, it seems that the OK button doesn't get sized correctly and so
instead of the normal OK text being displayed, just an ellipse is displayed?

--gordon tillman (g...@mindspring.com)

Steve Cocks

unread,
Nov 16, 1998, 3:00:00 AM11/16/98
to
Olivier

Thanks for the help.

Cheers
Steve


0 new messages