Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Tolls

Thread: Logout button

  1. #1
    iNko is offline Member
    Join Date
    Dec 2012
    Posts
    55
    Rep Power
    0

    Default Logout button

    Hey, i got a loginjFrame, witch when u enter correct data into fields, closes itself and opens a new jFrame2. On jFrame2 i want to have a logout button, witch when pressed opens back loginjFrame and 'ends session?'.
    This is the current code i have in my logout button:
    Java Code:
           dispose();
            loginJFrame s = new loginJFrame();
            s.setVisible(true);
    It closes jFrame2, opens loginjFrame, but does not 'end session'.
    Maybe i need to use something with ' System.exit(0);' ?

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    8

    Default Re: Logout button

    What do you mean by 'ends session'? What kind of session is this?

  3. #3
    iNko is offline Member
    Join Date
    Dec 2012
    Posts
    55
    Rep Power
    0

    Default Re: Logout button

    Quote Originally Posted by wsaryada View Post
    What do you mean by 'ends session'? What kind of session is this?
    I mean its not really a logout, it just shows the login menu window and closes the jframe2..

    Heres an example - on jframe2, everytime i minimize the window, it gets in system tray. If i press the logout button, it minimizes jframe2, opens login frame, but the previous jframe2 is still running in system tray.. So i can have multiple jframe2 windows opened by doing so..

    Maybe i need to fix my system tray idk

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: Logout button

    I'd fix your app.
    Do you actually want to have multiple JFrame2?

    If not then I would make your app a single frame, including the login one.
    DarrylBurke likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    iNko is offline Member
    Join Date
    Dec 2012
    Posts
    55
    Rep Power
    0

    Default Re: Logout button

    Quote Originally Posted by Tolls View Post
    I'd fix your app.
    Do you actually want to have multiple JFrame2?

    If not then I would make your app a single frame, including the login one.
    Thx for the offer, but i wanna try learn myself :)

    anyway, i somehow managed to fix my problem by deleting out some code..

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: Logout button

    That wasn't an offer, it was a suggestion.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Back button is working after logout the application
    By srinivasmallabathula in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-28-2012, 11:12 AM
  2. logout in struts2
    By sunithamm in forum Struts
    Replies: 7
    Last Post: 03-07-2012, 09:32 AM
  3. logout
    By mehak in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-07-2011, 09:40 AM
  4. logout by disabling back button
    By sandy004.u in forum Java Servlet
    Replies: 5
    Last Post: 02-04-2010, 11:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •