• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

about the addWindowListener()

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is here:
I have two frames, one calls another. the child jframe modifies a text file which is displayed in the parent jframe. I want to Update this change when I close the child jframe. How should I do it?
I checked some related topics about the getting sub-window handle. seems I need a listener to listener to the closing event to achieve it. anybody has any idea? Thanks a lot.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at the examples in this post... main frame launches child frames that affect the parent.
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like what you want is commonly referred to as a callback. Java doesn't have callbacks in the traditional sense....However you can implement an interface to get the same result. Or, if this is a one-time deal you could just pass the parent as a Constructor argument.
basically:

Then in the parent... do the following


is this what you're looking for?

Good Luck
reply
    Bookmark Topic Watch Topic
  • New Topic