Frage

I'm wondering if it is possible to put a CheckBox and string in one cell. The string would be used to track how long the checkbox was checked for. I'd like the cell to be laid out like the ColorRenderer cell in this example.

The problem is I can't find a method to set the checkbox on the JLabel.

War es hilfreich?

Lösung

As shown in the complete example cited here, you can use setText() on an instance of your custom TableCellRenderer.

image
(source: drjohnbmatthews at sites.google.com)

Related examples similar to ColorRenderer are shown here and here.

image

image

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top