Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create a Jbutton inside a Jtable?  RSS feed

 
Alan Blass
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to create a Jbutton inside a Jtable? I have:



but inside the cell it gives me a long text:



the button is not displayed.

Also, how to handle the mouse event when the button is clicked? Any pointers? Thanks
 
Rob Spoor
Sheriff
Posts: 21090
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out how table cell renderers and editors work. In this case I'd read this article by "our own" Rob Camick.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at Rob Camick's Table Button Column
http://tips4java.wordpress.com/2009/07/12/table-button-column/
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!