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
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.
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
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.
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
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.
idanbob (September 12th, 2013)
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
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.
No I know what a JDialog is, thanks.