added a method for toggling controls in a javaFX interface