Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling a method added to tablemodel  RSS feed

 
Keith L
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add my own method to a tablemodel in addition to the ones that I'm required to include. The method will be used to generate tooltips. I've used an example from the Tutorial as a template. In the example below, I can generate a tooltip by invoking the getValueAt() method which is defined in the table model, but if I try to invoke my additional method, the compliler fails to find it.

 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you get a reference to the TableModel, you'll have to cast it to your specific subclass, and then you'll be able to call your method.
 
Keith L
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That did the trick. Thanks for your help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!