• Post Reply Bookmark Topic Watch Topic
  • New Topic

the sense of setModal(boolean) in JDialog inherited from Dialog

 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application shows an instance of JDialog (instanceOfJDialog).
There is
instanceOfJDialog.setModal(true);
then I instantiate and visualize an instanceOfJPanel (outside of instanceOfJDialog). But the instanceOfJPanel appears visually ONLY (tried a lot) after hiding instanceOfJDialog by
instanceOfJDialog.hide();
I thought that it is because instanceOfJDialog is modal (setModal(true)).
I tried to make instanceOfJDialog to be non-modal by
instanceOfJDialog.setModal(false);
(by the way setModal() is inherited from java.awt.Dialog but not from the javax.swing.JDialog)
but in this case instanceOfJPanel does not appear visually at all.
Is it bug? What is the sense of setModal() here then?
[This message has been edited by G Vanin (edited October 30, 2001).]
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if a dialog is modal and appears during the run of an application, then this application waits for the user input to this dialog, blocking all other possibilities for the user to act.
the graphical representation on the screen (swing) is layed out in different panes or layeres. normally the programmer needs not to worry about that as its well done by default. the default layer is underneath some other layers which include the popup layer and, I'm sure, something like the dialog layer. that means, that a dialog will appear by default on top of all your other components.
(if thats not close to your question, maybe some of your code will help to figure out what the problem is in your case)
chantal
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chantal,

if a dialog is modal and appears during the run of an application, then this application waits for the user input to this dialog, blocking all other possibilities for the user to act.
is just INCORRECT. And it was written in my question. When I call hide() on modal JDialog component, it just disappears and gives the way to appearance of of other components.
It is the really essence of question
I did not get anything useful from such your "reply-help", just implying and hinting. It would be helpful, at least, to give a link/reference

[This message has been edited by G Vanin (edited October 31, 2001).]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you posted the code that wasn't working, it would help us find your problem... I created some test code that made a modal dialog box, and had no problem adding components to the frame that launched the dialog... perhaps you just need to call validate() on the reference to your frame...

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!