Model-view-controller and Undo

Discussion in 'Java' started by Deniz Dogan, Nov 12, 2006.

  1. Deniz Dogan

    Deniz Dogan Guest

    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
     
    Deniz Dogan, Nov 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stan
    Replies:
    2
    Views:
    548
  2. Ralf Müller

    Model-View-Controller Pattern in ASP.NET

    Ralf Müller, Dec 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    938
    Ralf Müller
    Dec 29, 2004
  3. Griff
    Replies:
    4
    Views:
    658
    Griff
    Jan 26, 2006
  4. Replies:
    7
    Views:
    450
    Thomas Maier-Komor
    Jan 31, 2005
  5. Fritz Bosch
    Replies:
    0
    Views:
    430
    Fritz Bosch
    Sep 15, 2004
Loading...

Share This Page