-Aaron
Regards,
Jim
SCJP, SCJD, SCWCD, SCEA Part I
-Aaron
Originally posted by Aaron Dressin:
I am handling this problem by using SwingPropertyChangeSupport, but it is becoming quite convoluted.
Originally posted by Aaron Dressin:
Whose responsibility is it to keep track of the selected row in the view's table?
Originally posted by Aaron Dressin:
I believe that all of the event handling (business logic) should be handled by the controller... not by the model. The model represents the data and should not know anything about how the view interacts with the controller to manipulate it. It should only get updated and then the controller will notify the view of a model update.
Reid - SCJP2 (April 2002)
Originally posted by Robin Underwood:
The Controller should pass actual data (DataInfo[]) to the view, and the view should construct the TableModel from that data. All the controller needs to know from the view is which record was selected.
Reid - SCJP2 (April 2002)
Aaron Dressin wrote:My JTable is a member of the view class (ResultPanel)... not the model that backs it. When a user selects a particular row in order to book a flight, I need a way to pass the selected flight information (only known to the view) to the controller. I am handling this problem by using SwingPropertyChangeSupport, but it is becoming quite convoluted.
Whose responsibility is it to keep track of the selected row in the view's table?
Thanks,
**OCP, Java SE 6 Programmer**OCM, Java SE 6 Developer**
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |