如何防止JDialog在gnome-panel(Linux)中显示? [英] How do I prevent JDialog from showing in gnome-panel(Linux)?

查看:184
本文介绍了如何防止JDialog在gnome-panel(Linux)中显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堂课

public class ANote extends JDialog{...}

在GNOME(Linux)中,它在gnome面板中显示一个条目.我希望它不显示任何内容(在Windows下,JDialog的实例在Windows任务栏中不显示任何内容),因为可能同时存在该类的多个实例,这使gnome面板过于拥挤.

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.

如何防止它在gnome面板中显示实例?

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

到目前为止,我已经尝试过将模式隐藏在gnome面板中,但是将应用程序的主框架阻止在ANote实例后面.

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-为清楚起见编辑了帖子

EDIT2 - edited the post for clarity

推荐答案

我找到了一种解决方法;而不是使用以下方法实例化该类:

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

new ANote();

我将班级称为:

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

不再使gnome-panel包含此类的实例.它也可以在Windows XP上按预期方式工作(任务栏中没有任何条目).

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

这篇关于如何防止JDialog在gnome-panel(Linux)中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆