Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2006

Tip: Looking for answers? Try searching our database.

JOptionPane - Hide the "X" button

Thread view: 
Alex V. - 31 May 2006 16:45 GMT
Is there a way to hide/mask/not show the X (close) of the window when
showing a JOptionPane.showMessageDialog ?

Thank you !
Steve W. Jackson - 31 May 2006 19:47 GMT
> Is there a way to hide/mask/not show the X (close) of the window when
> showing a JOptionPane.showMessageDialog ?
>
> Thank you !

Not really, no.  Most of the methods of JOptionPane create the dialog
for you and use a platform-native appearance for the title bar,
decorations, etc.  Even if you make your own dialog from JDialog,
they'll be decorated by default.  You can set them undecorated, but then
you have the additional responsibility of providing your own title bar,
and I suspect you don't want that.

What you probably really want to do is what the vast majority of
programs do, which is to simply construct a dialog that doesn't respond
to the decoration.
Signature

Steve W. Jackson
Montgomery, Alabama

Thomas A. Russ - 01 Jun 2006 00:12 GMT
> > Is there a way to hide/mask/not show the X (close) of the window when
> > showing a JOptionPane.showMessageDialog ?

Why do you want to make a message dialog that the user can't close?

There is a real benefit to following the standard conventions of the
system you are using.

> Not really, no.  Most of the methods of JOptionPane create the dialog
> for you and use a platform-native appearance for the title bar,
> decorations, etc.  Even if you make your own dialog from JDialog,
> they'll be decorated by default.  You can set them undecorated, but then
> you have the additional responsibility of providing your own title bar,
> and I suspect you don't want that.

But that really is what needs to be done to have a quality interface.
(Either that or lobby for finer control over the window view).

Perhaps the best thing to do would be to simply hide the window on close
instead of getting rid of it.  Then, if your program needs to put it up
again, it can.

> What you probably really want to do is what the vast majority of
> programs do, which is to simply construct a dialog that doesn't respond
> to the decoration.

I think this is a terrible suggestion.

The whole point of having and using consistent interface elements is so
that the user can predict what will happen when they do various things.
If you keep the decoration but disable the function, this will only
serve to confuse and annoy your users.  You really don't want to do
that, do you?

Signature

Thomas A. Russ,  USC/Information Sciences Institute



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.