Java UI results in errors when accessed