简体   繁体   中英

javax.swing.JDialog freezes when it loss focus?

I'm writing a application using Swing. I have my main application frame ( javax.swing.JFrame ) which can open a my 1st javax.swing.JDialog , called ClientMngDialog which contains a javax.swing.JTable filled with data loaded from my database.

When the I select a client in the table, I want to open a 2nd javax.swing.JDialog , named ClientEditDialog on top of the 1st one, and then I can edit the informations of the selected client.

Both javax.swing.JDialog use Dialog.ModalityType.DOCUMENT_MODAL , since Javadoc says :

A document-modal dialog box blocks all windows from the same document, except windows from its child hierarchy. In this context, a document is a hierarchy of windows that share a common ancestor, called the document root, which is the closest ancestor window without an owner.

The 1st dialog works fine, nothing weired happend. But the 2nd one, which is over the 1st one, freezes when I click somewhere else outside the dialog ( maybe I can consider it as a loss of focus ). All the components on it don't respond anymore, and the only thing I can do is clicking its close button.

I've tried the Dialog.ModalityType.APPLICATION_MODAL , doesn't help, always the same problem. I have put SwingUtilites.isEventDispatchThread() everywhere, and it returns true as expected.

Anybody has a clue please ?

ps I'm using Debian Wheezy with Xfce 4 Desktop.

The problem disappeared after rebooting my computing. Really weired, and I don't know why.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM