Question : Set JTable cell text to bold

I want to set the text of a cell in a JTable to bold on a ctrl click.
Below is the listener that captures the ctrl-click (in the class extending JTable).
I'm not sure how to get the JLabel of the cell at (row,column) and how to set the font.
Can you suggest how to do this?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
// ctrl -click
if ((event.getModifiers() & ActionEvent.CTRL_MASK) > 0) {
    Point point = event.getPoint();
    int row = rowAtPoint(point);
    int column = columnAtPoint(point);
    // if not valid then return
    if ( row < 0 || column < 0) {
	return;
    }

    // if this click was on the firstcolumn
    if (column == 0) {
        ? get cell at (row,column)
        ? set to bold
        ((JLabel)cell.getCellRenderer()).setFont(new Font(("Courier", Font.BOLD, 12));
     }

Answer : Set JTable cell text to bold

Perhaps you could have the ctrl-click handler update a selected attribute that is used by the renderer to make the selected cell bold?
Random Solutions  
 
programming4us programming4us