CardLayout cl = (CardLayout) (jPanel1.getLayout()); cl.show(jPanel1, "LoginPanel");