Here you can find the source of getTransparentGraphicsConfiguration()
static GraphicsConfiguration getTransparentGraphicsConfiguration()
//package com.java2s; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { static GraphicsConfiguration getTransparentGraphicsConfiguration() { try {//from w w w. j a v a2 s . c o m Class<?> awtUtilitiesType = Class.forName("com.sun.awt.AWTUtilities"); Method isTC = awtUtilitiesType.getMethod("isTranslucencyCapable", new Class[] { GraphicsConfiguration.class }); GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] devices = env.getScreenDevices(); GraphicsConfiguration translucencyCapableGC = null; for (int i = 0; (i < devices.length) && (translucencyCapableGC == null); ++i) { GraphicsConfiguration[] configs = devices[i].getConfigurations(); for (int j = 0; (j < configs.length) && (translucencyCapableGC == null); ++j) { Boolean res = (Boolean) isTC.invoke(null, new Object[] { configs[j] }); if (res.booleanValue()) { translucencyCapableGC = configs[j]; System.out.println("FOUND translucency capable GC: " + configs[j]); } } } return translucencyCapableGC; } catch (ClassNotFoundException cnfe) { return null; } catch (NoSuchMethodException nsme) { return null; } catch (IllegalAccessException iae) { return null; } catch (InvocationTargetException ite) { } return null; } }