Java tutorial
//package com.java2s; import java.lang.reflect.Constructor; import java.lang.reflect.Method; public class Main { private static Class epdControllerClass; private static Class epdControllerRegionClass; private static Class epdControllerRegionParamsClass; private static Class epdControllerWaveClass; private static Class epdControllerModeClass; private static Object[] waveEnums; private static Object[] regionEnums; private static Object[] modeEnums; private static boolean successful = false; public static void setGL16Mode() { System.err.println("Orion::setGL16Mode"); try { if (successful) { Constructor RegionParamsConstructor = epdControllerRegionParamsClass.getConstructor(new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE, epdControllerWaveClass }); Object localRegionParams = RegionParamsConstructor .newInstance(new Object[] { 0, 0, 600, 800, waveEnums[1] }); // Wave = GU Method epdControllerSetRegionMethod = epdControllerClass.getMethod("setRegion", new Class[] { String.class, epdControllerRegionClass, epdControllerRegionParamsClass, epdControllerModeClass }); epdControllerSetRegionMethod.invoke(null, new Object[] { "Orion", regionEnums[2], localRegionParams, modeEnums[2] }); // Mode = ONESHOT_ALL } } catch (Exception e) { e.printStackTrace(); } } }