• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data model

 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic