Forums Register Login

about the addWindowListener()

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Take a look at the examples in this post... main frame launches child frames that affect the parent.
+Pie Number of slices to send: Send
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
Is this the real life? Is this just fantasy? Is this a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1615 times.
Similar Threads
what to put here
JPanel and JFrame listener
about JFrame and JOptionPane
Retrieve relationship between hibernate entities via Code
child panel
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:12:17.