Java version of GenericUI