小编Las*_*zki的帖子

使Java应用程序对用户不可见

我正在试图找到一种方法使Java应用程序对用户不可见.

基本上只是试图删除这个

任务栏图标 < - 图像

如何才能做到这一点?

public class TransparentWindow extends JFrame {

public TransparentWindow() {
    initComponents();
}

@SuppressWarnings("unchecked")
private void initComponents() {
    setExtendedState(Frame.MAXIMIZED_BOTH);
    setResizable(false);
    setUndecorated(true);
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    setAlwaysOnTop(true);
    System.setProperty("sun.java2d.noddraw", "true");
    WindowUtils.setWindowTransparent(this, true);
    WindowUtils.setWindowAlpha(this, 0.6f);
}

public static void main(String[] args) {
    new TransparentWindow().setVisible(true);
}
}
Run Code Online (Sandbox Code Playgroud)

java swing trayicon jframe jwindow

2
推荐指数
1
解决办法
3532
查看次数

标签 统计

java ×1

jframe ×1

jwindow ×1

swing ×1

trayicon ×1