This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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
It's not a secret anymore!