JTable with no focus indication



I have a non-editable JTable. I want to remove the border around the cell that
currently has the focus.

So far, the only thing I've been able to do is to create my own cell renderer
thus:


class MyRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
return super.getTableCellRendererComponent(table, value,
isSelected,
false, // Always false
row, column);
}
}



Surely there must be a simpler way to remove the focus border. Isn't there?

--
Claus Tondering, Denmark

.



Relevant Pages

  • Re: How to test an adjacent cell for blank in conditional formatting
    ... I gave this the same pattern color, but added the border. ... If that cell ... conditional formatting, to do one or the other, or even both, if every ...
    (microsoft.public.excel)
  • Re: simpler example of the padding bug
    ... It's not a bug. ... |> width of the contained content, plus the padding, plus the border, plus ... The margin, border and padding ... 100% inside a table cell, the outer edge of the content would be the same ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: How to test an adjacent cell for blank in conditional formatting
    ... I gave this the same pattern color, but added the border. ... I want the pattern in any cell ... I can write the conditional formatting to do both with one condition, ...
    (microsoft.public.excel)
  • Re: Glitches with Excel in Leopard
    ... the feature is more sensitive in 2008 for the same reasons you cite. ... when you double-click on a cell *border*, ... the top cell in that column. ...
    (microsoft.public.mac.office.excel)
  • Re: simpler example of the padding bug
    ... |> as the inner edge of the table cell. ... Can you explain the context in a: | the red box should line up with the border of the blue box | way. ... While the button box contents remains unchanged, if I add 1 pixel of padding ... pixel in layout. ...
    (comp.infosystems.www.authoring.stylesheets)