Problem with event on custom JPanels
Greetings!
I need to create a GUI that offers a view of an entire month's days, allows a certain selection for each day using JRadioButtons and displays the user's input for each week.
So far i've created:
- a "DayPanel" class that contains the radio buttons and variables for storing input
- a "WeekPanel" class with a variable - length array of "DayPanels" (depending on the week's number of days) and a "countPanel" that displays user input for that week.
This "countPanel" is updated by a call to a method in the parent "WeekPanel" from a "DayPanel's" ActionListener passing the "DayPanel's" selection value.
- a MonthPanel" class to display an entire month which contains an array of weekPanels.
All classes extend JPanel.
If i use a single "WeekPanel" everything works fine. However,as soon as more than one is in use only the "countPanel" of the "WeekPanel" that was last added to the "MonthPanel" is updated, regardless on which "WeekPanel" the selection change occured.
What's even stranger is that ActionEvent.getSource().getParent() returns the name of the correct "WeekPanel" but, as mentioned, only the last "WeekPanel's" "countPanel" is affected.
Anybody have an idea ?
THX,
c2

