[JAVAGUI] change method signature to enhance the robustness