wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Highlighting in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Highlighting in JTable" Watch "Highlighting in JTable" New topic
Author

Highlighting in JTable

Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 436
Hi,

I use this format to highlight words in a sentence:

<html>This is a <body bgcolor=yellow text=red><b>WORD</b> to be higlighted</body></html>

....but what is the proper format?

Thanks,

Maki Jav


Help gets you when you need it!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42033
    
  64
I'm not sure what you mean by "proper format". If it works then it would seem to be proper enough

Swing can deal with HTML 3.2, so if you're curious what you can and can not use, have a look at the specification.


Ping & DNS - my free Android networking tools app
Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 436
Hi,

Thanks for your answer. I think that there is proper way to write html. What I am doing is using a hack.

I write html pages so I know that you use <span> tag for highlighting but I was not successful with that

Maki Jav
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

I doubt span is supported within JLabels, also since span itself is nothing - only if you set it's style or class will it have any meaning.

You could try font though.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 436
Yes <font> could be used but I need a yellow background of the highlighted word


Maki Jav
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

Font can have a bgcolor as well
 
GeeCON Prague 2014
 
subject: Highlighting in JTable