This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Highlighting in JTable

 
Maki Jav
Ranch Hand
Posts: 445
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maki Jav
Ranch Hand
Posts: 445
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maki Jav
Ranch Hand
Posts: 445
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes <font> could be used but I need a yellow background of the highlighted word


Maki Jav
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Font can have a bgcolor as well
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic