File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JDialog - odd modal behavior Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JDialog - odd modal behavior" Watch "JDialog - odd modal behavior" New topic

JDialog - odd modal behavior

Gail Mikels
Ranch Hand

Joined: May 07, 2001
Posts: 634
Ok - this is kind of a weird one. I have a login button which, upon an invalid login produces a JDialog informing the user of the invalid login. The JDialog has been setModal(true). What I've found is that if the user clicks the button multiple times quickly (like, for instance, if they double-click instead of just single-click), I get multiple dialog boxes. I've tried disabling the login button as soon as it's clicked & disposing the dialog before creating it, but it doesn't seem to help.

Any advice?

Gail Mikels
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
I can't reproduce your decription - win98se, java 1.4.0_01

can you post a small sample program to demonstrate the problem
(just a frame with button, that opens a modal JDialog)
Gail Mikels
Ranch Hand

Joined: May 07, 2001
Posts: 634
Hmmm. My test app won't reproduce it either. Will debug from there.

Thanks anyways! :-)
I agree. Here's the link:
subject: JDialog - odd modal behavior
Similar Threads
Dialog modality problem
Correct behaviour when launching a new window and getting rid of the first window
Setting owner of JDialog
JDialog suspending while setVisible(true)
Application Modal JDialog is blocking its child JDialog