Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to call non-static method seticon  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here, the setIcon is a non-static method, but I'm in a static context, how
do I solve this?
Thanks
Jack

 
Luke Leber
Ranch Hand
Posts: 69
2
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the fully qualified method? I'm assuming that 'setIcon' doesn't exist in the supertype of your DefaultTableModel extension...so in other words, there isn't enough code posted to give a concrete answer.

Just a blind stab at it, assuming you have an instance of the class with the 'setIcon' method, you can pass it in as a parameter to your 'resultSetToTableModel3' method and set the instance's icon through that reference.

Good luck!
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First you have to tell us what it is whose icon you want to set. You can't just ask about calling a method, you also have to ask whose method you want to call. So do you have something whose icon you want to set?
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:First you have to tell us what it is whose icon you want to set. You can't just ask about calling a method, you also have to ask whose method you want to call. So do you have something whose icon you want to set?


Hello,
I sort of want to render an icon next to the text
But I've solved it, thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!