• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing Table Renderer add Button but no relation between them!  RSS feed

 
Florian Marquardt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have an problem in Swing i wrote an Renderer for the JTable so that i have got an button in the last column.
But i don�t know how to get an relation between table and Renderer. First i try to set the table via the constructor but i have got an exception because i must provide an blank constructor.
So i try to make an setter for the table but i never got the renderer i set it. That�s my problem.
Swing makes serveral renderer so when i click on the button the table is null because i was getting the wrong object of the renderer. How can i solve that? How can i get from the renderer to the row when i click?

Thank you
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Florian Marquardt:
.. How can i get from the renderer to the row when i click?


JTable#getCellRenderer(int row,int column)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!