aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes the term modal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "the term modal" Watch "the term modal" New topic
Author

the term modal

kenji mapes
Ranch Hand

Joined: Jun 16, 2005
Posts: 38
My Professor used the terms modal and non-modal during a GUI design class module.

Would anyone care to elaboarate on the terms for me?

Thanks.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

If something is "modal" it has "modes". A "mode" is a situation in which you're only allowed to do one thing. For example a "model dialog box" is one that forces you to interact with it, preventing you from using the rest of the application's windows; a non-modal dialog box leaves the windows behind it still responsive.

Another example: most graphics programs are modal; each tool is a mode. In pencil mode you draw pencil lines, in eraser mode you erase, etc.


[Jess in Action][AskingGoodQuestions]
kenji mapes
Ranch Hand

Joined: Jun 16, 2005
Posts: 38
Thanks, just what i was looking for.
kenji mapes
Ranch Hand

Joined: Jun 16, 2005
Posts: 38
Ugh, forgot to ask. JOptionPanes are mostly non-modal that I know of. How about JDialogs?
Morgan Christian
Greenhorn

Joined: Apr 06, 2005
Posts: 7
I usually use jdialogs for 100% required input or errors/notices etc...

modality (is that really a word?) can be set by myDialog.setModel(boolean).


**<br />Still trying to code myself out of this wet paper bag...
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
Originally posted by kenji mapes:
Ugh, forgot to ask. JOptionPanes are mostly non-modal that I know of. How about JDialogs?


The only type of dialog generated by JOptionPane that is not modal is a message dialog. The other three are modal: confirm, option and input. JDialog has several constructors and those that do not have parameter for modality are non-modal. Those that do have a parameter for it use the parameter. Any Dialog can have it's modality changed using setModal(boolean).

You should see the JDialog documentation for more information. JOptionPane, regrettably, does not document very well the modality of it's dialogs, but I've already mentioned what each one is.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: the term modal