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

Thread: Switching Between JFrames - Please help!

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Location
    South Africa
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile Switching Between JFrames - Please help!

    Hey there!
    Is it possible to switch between a JFrame? i.e When one button is clicked on my JFrame, I want it to open another JFrame immediately. If so, how? Thanks


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Switching Between JFrames - Please help!

    I suggest you use a JDialog as the second container rather than another JFrame. And, yes, of course it's possible. If you have code that tries to accomplish this amazing feat but falls short, then please post it, and we'll help you fix it.

  3. #3
    Junior Member
    Join Date
    Sep 2013
    Location
    South Africa
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Switching Between JFrames - Please help!

    Ok so this is probably a really stupid question - what's a JDialog? I've never used one *embarassedface* And by calling it an "amazing feat" are you implying that it's rather difficult? Thanks

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Switching Between JFrames - Please help!

    Nope, not difficult. It is amazing and especially challenging to those new to OOP who have not yet switched their thinking of programming as creating and acting on objects.

    For Java information about classes, including Swing components that you've never heard of, refer to the API. When you Google, "jdialog," for example, the first result will usually be that item's API page. You might also try "jdialog tutorial" to find the Java Tutorial on the subject.

  5. The Following User Says Thank You to GregBrannon For This Useful Post:

    idanbob (September 12th, 2013)

  6. #5
    Junior Member
    Join Date
    Sep 2013
    Location
    South Africa
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Switching Between JFrames - Please help!

    Alright thanks so much, really appreciate the help!

    --- Update ---

    Omg I just realised what a JDialog is, of course I know it it was like the first thing I ever learned. I feel like such an idiot lol

  7. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Switching Between JFrames - Please help!

    You might be thinking of JOptionPane and its show dialog methods. You would normally learn that before learning about JDialog, but I could be wrong.

  8. #7
    Junior Member
    Join Date
    Sep 2013
    Location
    South Africa
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Switching Between JFrames - Please help!

    No I know what a JDialog is, thanks.

Similar Threads

  1. 2 JFrames In One Applaction.
    By Java Programmer in forum Java Theory & Questions
    Replies: 5
    Last Post: January 9th, 2012, 11:47 PM
  2. Duda Con JFrames
    By GuzmanDiaz18 in forum AWT / Java Swing
    Replies: 3
    Last Post: June 2nd, 2011, 03:24 AM
  3. JFrames and JMenuBars
    By rushhour in forum AWT / Java Swing
    Replies: 3
    Last Post: November 4th, 2010, 05:14 PM
  4. JFrames not coming up?
    By scooty199 in forum AWT / Java Swing
    Replies: 13
    Last Post: October 30th, 2010, 02:54 AM
  5. Multiple JFrames
    By Scottj996 in forum AWT / Java Swing
    Replies: 1
    Last Post: April 15th, 2010, 05:24 AM

Tags for this Thread