ho, ho, ho
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:1) Use a custom TableCellRenderer
2) Use the UIManager class to set the colors for the following properties:
- Table.selectionBackground
- Table.selectionForeground
ho, ho, ho
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));
ho, ho, ho
ho, ho, ho
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
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.
ho, ho, ho
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |