How do I prevent JDialog from showing in gnome-panel(Linux)?

佐手、 提交于 2019-12-11 18:34:37

问题


I have a class:

public class ANote extends JDialog{...}

In GNOME(Linux) it shows an entry in the gnome-panel. I want it to show nothing (under Windows the instances of JDialog show nothing in the Windows taskbar), because there may be present several instances of the class simultaneously, and this overcrowds the gnome-panel.

How do I prevent it from showing an instance in the gnome-panel?

EDIT: So far I have tried playing with the modality, which hides it from the gnome-panel, but blocks the main frame of the application behind the ANote instances.

EDIT2 - edited the post for clarity


回答1:


I have found a workaround; instead of instantiating the class with:

new ANote();

I call the class as:

JWindow aNoteWindow = new JWindow(new ANote());

which no more overcrowds the gnome-panel with instances of this class. It also works as expected on Windows XP (no entries in the taskbar).



来源:https://stackoverflow.com/questions/2439085/how-do-i-prevent-jdialog-from-showing-in-gnome-panellinux

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