Rob Prime wrote:1) Use a custom TableCellRenderer
2) Use the UIManager class to set the colors for the following properties:
Michael Dunn wrote:is it really a JTextArea you're talking about?
if so, try the following line (before creation of textArea, and will affect all textAreas)
UIManager.put("TextArea.selectionBackground", new javax.swing.plaf.ColorUIResource(Color.YELLOW));
Frankey James wrote:yeah. most other people i've seen use a jtextrea or jtextpane. i've not seen any examples of jtable used for java editor. i'll just have to mess with jtable more, otherwise result to using a rectangle to highlight a jtextarea row.
Rob Prime wrote:The JTable confusion is my fault - I saw the combination of "selected row" and "JT", and automatically read JTable...
You could check out javax.swing.text.Highlighter in combination with a HighlighterPainter. Simply search for the start and end of the block to highlight, then call addHighlight on the Highlighter.