1 Replies - 177 Views - Last Post: 19 May 2014 - 12:33 AM Rate Topic: -----

#1 kosmro  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 63
  • Joined: 07-March 12

JFrame won't hide when new Applet starts

Posted 18 May 2014 - 09:47 PM

This may seem a little ambiguous, however I am trying to complete a small detail in my code which for the life of me, can't figure out!

I have a login window, which when sucessful will activate a new Applet/JFrame. The problem is that the login window remains in the background under the new JFrame. I want this to diappear. I want to either set the visibility to false, or close it. But I don't understand how to do this.

This is how the new window is started:
if(sucess.equals("flase")){
                
                DBAccess dba = new DBAccess();
                dba.setFname(fnameusr); //fnameusr
                dba.setLname(lnameusr); //lnameusr
                dba.main(null);
                
                //LogIn.exit(0);
            }else{
                JOptionPane.showMessageDialog(null, "Your credentials were not entered correctly or you may not be authorised to access this system.");
                System.exit(0);
            }


Anyone have any ideas on how I could do this?

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: JFrame won't hide when new Applet starts

#2 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2783
  • View blog
  • Posts: 11,775
  • Joined: 20-September 08

Re: JFrame won't hide when new Applet starts

Posted 19 May 2014 - 12:33 AM

A CardLayout is best for what you want to do - particularly in an applet:
http://technojeeves....with-cardlayout
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1