aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes InterActing InternalFrames in SWING - MDI Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "InterActing InternalFrames in SWING - MDI Application" Watch "InterActing InternalFrames in SWING - MDI Application" New topic
Author

InterActing InternalFrames in SWING - MDI Application

Manoj Amrutkar
Ranch Hand

Joined: Apr 15, 2006
Posts: 47
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
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
But how exactly to get the reference of second frame?
Some code sample will be really helpfull.

Thanks
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: InterActing InternalFrames in SWING - MDI Application