• Post Reply Bookmark Topic Watch Topic
  • New Topic

Data model  RSS feed

 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys: I'm creating an application based on Swing, it's a rather complex application, it contains different data models, like TreeModel, tablemodel, etc. This application deals primary with data from database, and interpretation (math) on those data. Is there any kind of patterns or design I can use to make the application data work seamlessly with Swing data model?
For example: one of the JTree is to display data query from database, there is a JTable that also displays the data but with the addition of calculated result. I was wondering, how can make JTable and JTree to use the same based data?
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First get the data from database in to a datamodel - a model class to store data. Depending on the requirement, construct treemodel/tablemodel from that class and present it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!