I have written many FORTRAN codes, but am new to Java, which I find much more powerful and more difficult.
I have a program that was written several years ago in MS Access.
The program consists of a main window with buttons that take you to other windows where you input data and make queries.
Things have changed and the program needs to be rewritten. I want to rewrite it in Java.
I have written many small programs in Java, but they just do engineering calculations and only involve one window or screen.
To write Java programs, I have been using netbeans 5.5 and can easily design guis and add functionality.
However, I cannot figure out how to code multiple windows that interact with each other. For example, I would like to do the following:
1. Add a button1 to JFrame1, which will be the main screen-size window (I think they call it the Parent)
2. Add a button2 to JFrame2, which will be a secondary screen-size window (I think they call it a Child).
3. Add functionality so that when button1 is clicked, JFrame2 is displayed instead of JFrame1.
4. When button2 is clicked, JFrame1 is displayed again. Can you suggest how I can do this? I don't see it covered in the three Java books I have been using.
Can supply a simple Java code that does this or direct me to a reference that explains how to do write the code.
Thank you.
jdseader 1 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
peter_budo commented: Nice example, what more can I say :) +6
jdseader 1 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
jdseader 1 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
jdseader 1 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
jdseader 1 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
jdseader 1 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
jdseader 1 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
jwenting 1,889 duckman Team Colleague
darkagn commented: A good tip :) +1
jdseader 1 Newbie Poster
twmgeo 0 Newbie Poster
stultuske 1,116 Posting Maven Featured Poster
twmgeo 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.