Changed the method Jpanel.show() to setVisible(true) because show is deprecated