import java.lang.reflect.*; public class XWMTest1 { public static void main(String[] args) throws Exception { Class clazz = Class.forName("sun.awt.X11.XWM"); Method init = clazz.getDeclaredMethod("init", (Class[])null); init.setAccessible(true); init.invoke((Object[])null); for(Method method : clazz.getDeclaredMethods()) { if (method.getName().startsWith("is") && Modifier.isStatic(method.getModifiers()) && method.getReturnType() == boolean.class) { Class[] clazzArray = method.getParameterTypes(); if (0 == clazzArray.length) { method.setAccessible(true); Object ret = method.invoke(null, (Object[])null); System.out.printf("%-20s = %b%n",method.getName(),ret); } } } } }