This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons 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! :-)
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: JDialog - odd modal behavior
Similar Threads
Application Modal JDialog is blocking its child JDialog
Setting owner of JDialog
Dialog modality problem
Correct behaviour when launching a new window and getting rid of the first window
JDialog suspending while setVisible(true)