closed #14; might reduce redundancy further later on
closed #11, and also handling tab changes with a ChangeListener