2

I can add buttons to a table with TableCellRender, but those buttons look different from normal buttons, e.g., when the mouse is over, there's no rollover effect. Anyone know how to make buttons in a table look and feel the same as normal buttons?

Zhao Yi
  • 2,335
  • 7
  • 23
  • 27
  • A cell renderer is a static representation of the component. It is not a live component, try taking a look at [Table Button Column](http://tips4java.wordpress.com/2009/07/12/table-button-column/) – MadProgrammer May 22 '13 at 06:31
  • Any Solutions? ... stumbled upon the same problem. – dastrobu Oct 28 '15 at 15:06

1 Answers1

1

Short example provide in link which demonstrates approach on a checkbox renderer. The example extends default BooleanRenderer. The only change is getModel().setRollover(...) in getTableCellRendererComponent()

Rollover Effect in JTable Checkbox.

Hope this link help you to achieve rollover effect by implementing for your Button in Jtable.

Community
  • 1
  • 1
Alpesh Gediya
  • 3,706
  • 1
  • 25
  • 38
  • This can only partly solve the button issue. In Windows 7, if you look carefully, you can see that a button is continuously repainting itself, and I don't think a mouse listener can achieve this. – Zhao Yi May 23 '13 at 02:54