views:

26

answers:

3

hi, i'm traying a jdialog on linux, but it still appears in my taskbar. this is the code? what's wrong?

import javax.swing.JDialog;

public class Main {
    public static void main(String [] args) {
        new mydialog();
    }

    private static class mydialog extends JDialog {
        public mydialog() {
            super();
            setSize(200,200);
            setLocationByPlatform(true);
            setAlwaysOnTop(false);
            setUndecorated(true);
            setVisible(true);
        }
    }
}
A: 

try replacing setLocationByPlatform(true); with setLocation(10, 10);

jowierun
in this way you are only say to position the window at the coordinates 10-10 instead of 0-0.I tried and still does not work.on windows it works and on Linux it doesn't. i believe that is due to a different implementation of Java jre. I think the problem is unsolvable, unless a low-level intervention in jre classes.
Syco
A: 

You need to use JWindow if you don't want it to appear in the taskbar.
See also: how-do-i-prevent-jdialog-from-showing-in-gnome-panellinux

Devon_C_Miller
JWindow stay always on top, and there are a lot of problems with text dialogs and buttons inside. It's good for splash screen, but i don't believe it's usefull for standard applications.
Syco
A: 

the only solution I found is to switch from Swing interfaces to gtk interfaces, to do this I used java-gnome. the only problem is that you must change all components of the swing classes to the corresponding gtk classes.

Syco