JButton tool tip shows up but the rollover icon does not.

I put a JButton into a cell in JTable. When the mouse moves over the button, the tool tip shows up, but the rollover icon does not.
If I click the button, then both tool tip and rollover icon will behave correctly.
Is that a bug?

The JTable doesn't know it's a button. It knows it's a JComponent, and a TableRenderer only. Tooltips are from JComponent. JTable can't sit there and analyze the renderer components to cover all the possible bases for what a component might do.
The key thing to understand is that the JTable basically takes a screenshot of the returned component.
The only way I know to do what you want is to add a mouse listener to the table, figure out the cell moused over, and update something in the model that can tell the renderer component to go to a mouse over state for table to repaint with.

Similar Messages

Maybe you are looking for