• Post Reply Bookmark Topic Watch Topic
  • New Topic

mvc design pattern

 
raja ramesh
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybody please explain how to implement JTable using MVC design pattern ?

Thanks in advance.
 
Rob Spoor
Sheriff
Posts: 20819
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Model: the TableModel implementation you use
View: the JTable itself
Controller: whatever modifies the model.

Basically, you create a TableModel (mostly a DefaultTableModel or a subclass) first. You then create a JTable with the model.
Next you create any class you like that updates the TableModel. If you use DefaultTableModel or a subclass the model will update the table immediately.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!