• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

InterActing InternalFrames in SWING - MDI Application

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But how exactly to get the reference of second frame?
Some code sample will be really helpfull.

Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
reply
    Bookmark Topic Watch Topic
  • New Topic