简体   繁体   中英

Way to force KDE to not allow minimization of Java JDialog elements?

I have a Java application that uses JDialog boxes for displaying certain information. The JDialog boxes are not minimizable (and shouldn't be), but we've run into a problem specific to Linux KDE desktop (4.3.5, but I believe it probably applies to 4.x). KDE window decorators appear to be overriding Java's and are allowing minimization of JDialog boxes. Windows/Solaris/Linux (GNOME desktops) do not allow minimization of JDialog boxes, it appears to only be KDE. Is there an attribute that I am missing or other way to explicitly say this JDialog box should never be minimized?

Other potentially useful info: Java: JRE 1.6.0_17 Linux: openSUSE and SUSE Enterprise Server (both running KDE 4.3.5)

You can try removing the whole dialog title by calling dialog.setUndecorated(true) but this means that the dialog can't be moved anymore.

This related question also has some pointers: Remove "X" button in Swing JDialog

Though I cannot find a way to navigate around the JDialog minimization, I found a work around. Setting the visibility of the display to false, then toggling back to true causes the minimized window to become visible and available again:

myDialog.setVisible(false);
myDialog.setVisible(true);

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