Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import static java.awt.GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSLUCENT;
import static java.awt.GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT;
import static java.awt.GraphicsDevice.WindowTranslucency.TRANSLUCENT;

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;

public class Main {
    public static void main(String[] args) {
        GraphicsEnvironment graphicsEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();

        GraphicsDevice graphicsDevice = graphicsEnv.getDefaultScreenDevice();

        boolean isSupported = graphicsDevice.isWindowTranslucencySupported(PERPIXEL_TRANSPARENT);
        System.out.println("PERPIXEL_TRANSPARENT  supported: " + isSupported);

        isSupported = graphicsDevice.isWindowTranslucencySupported(TRANSLUCENT);
        System.out.println("TRANSLUCENT  supported: " + isSupported);

        isSupported = graphicsDevice.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT);
        System.out.println("PERPIXEL_TRANSLUCENT  supported: " + isSupported);
    }
}