Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Table Cell Renderer

 
Jeremy Hooie
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a custom class which extends JButton and implements TableCellRenderer. When the user clicks on a table cell (button), I want to open a new window. Can I use the ActionListener from JButton, or do I have to use a MouseListener?
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check example 2 at this site: http://www2.gol.com/users/tame/swing/examples/SwingExamples.html It creates a cell editor and does the processing there. One thing to be aware of. When user double clicks, this will create 2 windows one after the other.
Put your logic in the fireEditingStopped() method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!