only need to override setVisible, which is virtual