Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Modality API  RSS feed

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Application-modal. An application-modal dialog box blocks all windows from the same application, except for those from its child hierarchy. If several applets are launched in a browser environment, the browser is allowed to treat them either as separate applications or as a single application. The behavior is implementation-dependent."

Would an application-modal be appropriate for an application that requires the user to confirm before doing anything?
Is the attached, which is only being attached for educational purposes, an illustration of the child hierarchy mentioned? Is it complete?
Why do you think it is useful to allow objects in the child hierarchy not to be blocked?
Is there some overriding method() which allows me to switch modes, or would I have to design the application in modeless mode? This is because it is not always the case that I can predict all possible user scenarios, although I do my best to do so

Toolkit-modal. A toolkit-modal dialog box blocks all windows that run in the same toolkit, except those from its child hierarchy. If several applets are launched, all of them run with the same toolkit. Hence, a toolkit-modal dialog box shown from an applet may affect other applets and all windows of the browser instance that embeds the Java runtime environment for this toolkit."

Can you clarify and illustrate with a working example? Is the author referring to particular classes, such as java.awt.Toolkit?

Sourced from here.

Inheritance-hierarchy-for-the-Component-class.JPG
[Thumbnail for Inheritance-hierarchy-for-the-Component-class.JPG]
Inheritance hierarchy for Component class P.370(384)
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you think it is useful to allow objects in the child hierarchy not to be blocked?

You seem to be confusing child with subclass. A component is a child of the container it is housed in. A top level window like a dialog may be parented to another top level window, or may be parentless.

Factor that into your thinking and let us know whether you still have a question
 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:
Why do you think it is useful to allow objects in the child hierarchy not to be blocked?

You seem to be confusing child with subclass. A component is a child of the container it is housed in. A top level window like a dialog may be parented to another top level window, or may be parentless.

Factor that into your thinking and let us know whether you still have a question


Yes you're right, hence, a component is a child where I am creating a multiple document interface, such as a word processor, which has various child windows that include word processor documents, contained within the word processor application, as its parent. Since Java is a write once deploy anywhere, can I safely assume that using application modal dialogs will safely use functionality embedded within Windows-based and Unix-based OSs (and perhaps others?).

Have you encountered issues in this regard?

Sorry I keep confusing terminology

Would an application-modal be appropriate for an application that requires the user to confirm before doing anything?
Why do you think it is useful to allow objects in the child hierarchy not to be blocked?
Is there some overriding method() which allows me to switch modes, or would I have to design the application in modeless mode? This is because it is not always the case that I can predict all possible user scenarios, although I do my best to do so

Can you clarify and illustrate with a working example? Is the author referring to particular classes, such as java.awt.Toolkit?
 
Campbell Ritchie
Sheriff
Posts: 55292
156
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You see that most often with dialogue windows, for example those shown by JOptionPane.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!