Replaced deprecated "show()" with "setVisible(true)"