Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: TableModel Design

 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anybody show me where could I get the reference material (not the Sun usingswing thing),
of the TableModel design.
I wanna know how to get the data from the database and notify the TableModel when data changed.
Frank
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's missing out in Sun's tutorial. It's THE best as far as i know. The best way to go about is have some static table data and use the fire... methods to update the data table. Some basic stuffs wont be convincing unless you start coding .....
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going to hate myself in the morning, but if you do a search on Eugene's MVC posting, you will find a solution using the Observer and Observable interfaces to handle data changes to the JTable.
In my case whenever a new search is done, I just create a new TableModel, and use the setModel() method of the Jtable on the GUI.
I also had added a method to the TableModel, that could read a DataInfo[] class and change it to String arrays for the Jtable to understand. But that was in the previous version fo the assignment, although you can modify it to fit the New Assignment.
Mark
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!
Frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic