203.129.225.221 writes:
Can we make the frame as a modal one like a modal dialog box Anand
194.158.187.242 writes:
Yes there is.
Use setModal(true),
a method in Dialog.
Henk Jan
203.129.225.221 writes:
I want Frame to be of type Modal not dialog Anand Gore
24.1.16.214 writes:
both Dialog and Frame are derived from Window. Window does not have modal behavior, that behavior comes from the Dialog class. and I see that Frame has the ability to have a menu bar and change its cursor, behaviors which a Dialog does not have...
a comment I've seen throughout the page on Dialog is, " A modal Dialog grabs all the input to the parent frame from the user." but I don't know if that's a definition or a clue to an implementation or both.
if you do not need a menubar in this special modal frame, extend Dialog instead and you'll get modal behavior through inheritance.
the modal behavior of Dialog is itself written in Java, so it must be possible to write that behavior into a class that extends Frame instead. but other than having some clue that it involves having the parent frame ignore input while the modal one is open, I don't know how to code the behavior... don't some development environments let you inspect the source of these classes directly?
-calyxa