private static Camera makecam(Class<? extends Camera> ct, String... args)
            throws ClassNotFoundException {
        try {
            try {
                Constructor<? extends Camera> cons = ct
                        .getConstructor(String[].class);
                return (cons.newInstance(new Object[]{args}));
            } catch (IllegalAccessException e) {
            } catch (NoSuchMethodException e) {
            }
            try {
                return (ct.newInstance());
            } catch (IllegalAccessException e) {
            }
        } catch (InstantiationException e) {
            throw (new Error(e));
        } catch (InvocationTargetException e) {
            if (e.getCause() instanceof RuntimeException)
                throw ((RuntimeException) e.getCause());
            throw (new RuntimeException(e));
        }
        throw (new ClassNotFoundException(
                "No valid constructor found for camera " + ct.getName()));
    }