• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable and its MVC Architecture ??  RSS feed

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all friends,
Ian confused about JTable and its MVC Architecture.Can any one please explain it.
Thanks & Regards
Bikash
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the context of JTable, JTable deals with
the representation, while editing of the table
content is carried out through TableModel .
Create a TableModel instance and associate it with
the JTable object.Edit the table contents using the
Table Model.
MVC stands for Model-View-Controller.
Model is how the component is represented.
View is how the component appears.
Controller takes care of interpreting the actions.

----------------
Murthy DN
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
First of all thanks for ur reply.But Still I have some doubts.As per your explanation JTable is View , TableModel is Model then who is Controller.Can you please explain it little bit more.
Thanks & Regards
Bikash
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually there is default controoler implementation for each component.
But using event listeners, u can control how a JTable responds to
user actions and how the contents are controlled.
Hope this is clear
---------
MurthyDN
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks,Now it is clear to me.
Thanks & Regards
Bikash
 
Stuart Friedberg
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bikash,
The term MVC was developed a long time ago. There were not very many "pure" model-view-controller architectures with distinct components for all three roles. Even in those "pure" MVC architectures, it was very hard to find examples where a view (or controller) could be used with any controller (or view) other than the one it was initially designed for.
Swing makes no attempt to be a "pure" MVC architecture. Speaking generally, a Jxxx component implements both the view and the controller roles. Swing does maintain a good distinction between view-controller and model.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!