Adicionando jRadioButton em jTable
Estou tentando adicionarjRadioButton
para dentrojTable
. Eu usei o código dado
private class CustomCellRenderer extends DefaultTableCellRenderer {
/* (non-Javadoc)
* @see javax.swing.table.DefaultTableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
*/
@Override
public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected, boolean hasFocus, int row, int column) {
return new javax.swing.JRadioButton();
}
}
Mas quando eu corro isso eu estou ficandojTable
coluna em uma cor diferente e quando eu clico no botão de rádio, nada acontece. Eu estou usando netbeans. Se eu tentar personalizar ojTable
então nada aparecerá emjTable
. Me dê uma orientação adequada.