File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 435
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: 41108
    
  45
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: 435
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: 19653
    
  18

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: 435
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: 19653
    
  18

Font can have a bgcolor as well
 
 
subject: Highlighting in JTable
 
Similar Threads
getProperty question
how counter variable works in jsp
XML + XSL => HTML
html to xml (wordml) converstion
diff btw '&lt;!-...-&gt;' and '&lt;!--.. --&gt;'