File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes propertyChangeListener question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "propertyChangeListener question" Watch "propertyChangeListener question" New topic

propertyChangeListener question

Sabina Norderhaug

Joined: Oct 29, 2003
Posts: 6
I have child dialog for choosing dates which is called from parent UI:
This dialog implements PropertyChangeListener and there is a corresponding propertyChange method which sets new values for the dates.

Here is the code I have in parent UI to call this dialog:
Date startDate;
Date endDate;
ChooseDatesDialog datesChoice = new ChooseDatesDialog();
datesChoice.setTitle("Choosing dates");
How do I capture the event when date values are set within child dialog in this parent UI?
Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192

Thank you
Sabina Norderhaug

Joined: Oct 29, 2003
Posts: 6
Originally posted by Garandi Garandi:

My parent UI extends JPanel. I cannot apply addPropertyChangeListener(this); to it.
I can probably set parent UI to implement PropertyChangeListener and add propertyChange method to it.
Then again I already have PropertyChangeListener added to Date buttons within my child dialog.
Looks like I need to change the whole design
It is sorta covered in the JavaRanch Style Guide.
subject: propertyChangeListener question
It's not a secret anymore!