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 3 of 3

Thread: advance Jframe operation

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    29
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default advance Jframe operation

    I am creating a small GUI applications with multiple frames. Like a login screen, admin screen, member screen etc. The main frame is the login frame and then you could log in either as administrator or member. The administrator and member frames also has a bunch of buttons and clicking each each button again gives you another new frame for doing other stuffs.
    So now my problem is how do you switch back and forth between the frames. How do you make it like when I am in the admin screen the login screen disappears and when I am in admin panel and click one button and it shows another frame. And when I am currently in that frame then how do I make my Admin frame freeze. And when I logout of the admin panel it should also take me back to the login screen.
    I tried windowListener but cannot really figure out how to get it done.
    How do I really implement these kinds of things.
    Last edited by kindk12; June 15th, 2012 at 07:35 PM.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: advance Jframe operation

    Instead of separate frames look at using the CardLayout class.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    20
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: advance Jframe operation

    Just write f.setVisible(false) and try adding this actionlistener to the frame itself.Try if u can do that.

Similar Threads

  1. Kindly Review My Code :-) Thanks in advance
    By bhuppi in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 27th, 2012, 10:10 AM
  2. Help with Clock (advance and reverse day,hour,minute)
    By whyld4900 in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 13th, 2011, 02:39 AM
  3. Pls guide me in advance java
    By deepaks50 in forum Java Theory & Questions
    Replies: 3
    Last Post: May 19th, 2011, 08:55 AM
  4. Help with looping etc THANKS ALOT IN ADVANCE
    By moesom in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 15th, 2011, 10:43 AM
  5. Operation ==
    By meytalg in forum Java Theory & Questions
    Replies: 6
    Last Post: January 4th, 2010, 07:43 PM

Tags for this Thread