D
Deniz Dogan
Hello!
I want to write a relatively small Java application using the MVC design
pattern and I have a question about where to put each of the objects.
I have a view (JFrame) consisting of two JFormattedTextFields and one
JTable with multiple rows and two columns. Whenever the user selects a
row "N" in the JTable the two text fields will show the String stored in
the cell on row N and column 1 and 2, respectively. The user may then
alter the information stored in the two cells of row N by writing text
directly into the text fields.
Using a certain command the user may also merge lines together.
That was a simplified description of the problem at hand. My question is
now: Should I store the TableModel in my model class or is it better to
keep it in the view class? Also, how would I go about implementing undo
functionality to this application? Where would I store the UndoManager?
In the model class or the view class?
-Deniz Dogan
I want to write a relatively small Java application using the MVC design
pattern and I have a question about where to put each of the objects.
I have a view (JFrame) consisting of two JFormattedTextFields and one
JTable with multiple rows and two columns. Whenever the user selects a
row "N" in the JTable the two text fields will show the String stored in
the cell on row N and column 1 and 2, respectively. The user may then
alter the information stored in the two cells of row N by writing text
directly into the text fields.
Using a certain command the user may also merge lines together.
That was a simplified description of the problem at hand. My question is
now: Should I store the TableModel in my model class or is it better to
keep it in the view class? Also, how would I go about implementing undo
functionality to this application? Where would I store the UndoManager?
In the model class or the view class?
-Deniz Dogan