Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: How to exit a login form

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to exit a login form

    Hello guys, i am working on an application that requires a login. The problem is that after logging in with a correct user id and password the login form (LoginGui) is suppose to exit and the main window(MainWindowGui) will appear, but the login form still remains. I tried System.exit(0) before calling the main window gui(MainWindowGui()) but it exits the whole application.

    kinly advice me.

    uijbaba


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,607
    Thanks
    45
    Thanked 1,956 Times in 1,930 Posts

    Default Re: How to exit a login form

    Look at the API doc for the class that is visible that you want to be hidden and see what methods will work. For example setVisibile will hide a window.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to exit a login form

    I just tried setVisible(false) and it is able to exit the login form but after that any form that comes up you can see the login form embedded it.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,607
    Thanks
    45
    Thanked 1,956 Times in 1,930 Posts

    Default Re: How to exit a login form

    Can you make a small complete program that compiles, executes and shows the problem?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Apr 2011
    Location
    Niperia
    Posts
    30
    My Mood
    Amazed
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: How to exit a login form

    Why not just call the dispose() method on the LoginGUI if login/LogOut is successful?

    --- Update ---

    ...That is if the LoginGUI extends a JFrame.

Similar Threads

  1. while loop wont exit
    By NewAtJava in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 29th, 2011, 11:42 AM
  2. Problem in a web that uses javascript in his login form
    By kamarilla in forum What's Wrong With My Code?
    Replies: 8
    Last Post: June 1st, 2011, 05:47 PM
  3. Login form on webpage
    By rosebabz in forum JDBC & Databases
    Replies: 0
    Last Post: January 14th, 2010, 09:34 AM
  4. Java Swing :Back Button from one form to another form
    By srinivasan_253642 in forum AWT / Java Swing
    Replies: 1
    Last Post: December 26th, 2009, 08:51 AM
  5. While Loop Exit with String
    By Zaroth in forum Loops & Control Statements
    Replies: 8
    Last Post: November 9th, 2009, 03:20 PM