如何通过AWT(Debian)Java框架实现全屏?

如何通过AWT(Debian)Java框架实现全屏?,java,debian,awt,openbox,Java,Debian,Awt,Openbox,我有一个关于如何全屏显示AWT帧的问题? 全屏使用f.setExtendedState(Frame.MAXIMIZED_两者)但它会在应用程序顶部留下一个黑色条带 我以为它是装饰过的,我也把它弄坏了 f.未装饰(真) 有没有办法在菜单上也显示它 我正在使用Debian 10和Openbox 示例代码: class First2 { private BufferedImage image; First2() { try { image =

我有一个关于如何全屏显示AWT帧的问题? 全屏使用
f.setExtendedState(Frame.MAXIMIZED_两者)但它会在应用程序顶部留下一个黑色条带

我以为它是装饰过的,我也把它弄坏了
f.未装饰(真)

有没有办法在菜单上也显示它

我正在使用Debian 10和Openbox

示例代码:

class First2 {
    private BufferedImage image;

    First2() {
        try {
            image = ImageIO.read(new File("/home/x/Desktop/demo.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        Frame f = new Frame();
        Button b = new Button("click me");
        b.addActionListener(e -> {
            System.exit(0);
        });
        b.setBounds(30, 50, 80, 30);
        f.add(b);
        f.setUndecorated(true);
        **f.setExtendedState(Frame.MAXIMIZED_BOTH);**
        f.setLayout(null);
        f.setVisible(true);
    }
}