views:

396

answers:

1

it seems JTable can only allow checkbox. how can i put a radio group into a cell on the JTable?

A: 

your question is quite short, so i could have misinterpreted, but anyway A Boolean is by default registered with the jtable to be rendered/edited by a checkbox.

Depending on the cells'datatype the renderer/editor are retrieved when painting the cells. you could base a editor/renderer on a JPanel containing two radiobuttons which are grouped using a ButtonGroup. Depending on what data you want to store in the datamodel, you have various choices. if for example your datamodel contains ints, then your new editor/renderer should be able to work with that.

Houtman