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

喜夏-厌秋 提交于 2019-12-11 01:44:01

问题


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)


回答1:


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




回答2:


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);


来源:https://stackoverflow.com/questions/7449306/way-to-force-kde-to-not-allow-minimization-of-java-jdialog-elements

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!