InterActing InternalFrames in SWING - MDI Application
Manoj Amrutkar
Ranch Hand
Joined: Apr 15, 2006
Posts: 47
posted
0
Hi,
I have one Swing-MDI Application, where the structure is Outer Frame containing JDesktopPane, Which can open several internalframes.
Now i have two internalframes say IF1 and IF2.
IF1 has two textfields say tf1 and tf2, where as IF2 has third field say tf3. These IF1 and IF2 are interrelated by calculations as follows,
now suppose i have both the frames open simultaniously. And if i enters some value in tf1 and/or tf2 from IF1, The resulted sum should be reflected in tf3 of IF2.
How can i acheive above scenario.
Thanks in advance!
Manoj
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
depends on when you want the calculation done
a DocumentListener if you want immediate e.g. tf2 has 9.00, and you want to enter 123.45 into tf1 tf3 will display (with each keystroke) 10.00 21.00 132.00 132.40 132.45
if you want the calc after entering the number, an actionListener for 'enter' or for a separate button 'calculate'
Manoj Amrutkar
Ranch Hand
Joined: Apr 15, 2006
Posts: 47
posted
0
But how exactly to get the reference of second frame? Some code sample will be really helpfull.