Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2004

Tip: Looking for answers? Try searching our database.

Highlighter painter not inverting text on Windows with 1.5

Thread view: 
Bill Tschumy - 02 Nov 2004 04:18 GMT
I use a custom painter that extends
DefaultHighlighter.DefaultHighlightPainter to highlight some text of a
JEditPane.  The painter is created with a color that is the same as the
JEditPane's selection color.

On Windows, when using this painter, the highlight is drawn the correct color
but with Java 1.5 the text is not inverted as it should be.  Under 1.4 the
same code works fine.  The text in question is blue and is drawn using the
HTMLEditorKit when there is a hypertext link.

If I just use the mouse to select over this text, the text is highlighted in
the selection color and the text itself is drawn in white.  However, using
the same selectiion color in my painter the text is left blue and is hard to
read against the slightly darker blue selection color.

Anyone have any idea what changed in 1.4 -> 1.5 to cause this?  Know of a
fix?

Signature

Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com

Bill Tschumy - 02 Nov 2004 18:21 GMT
> I use a custom painter that extends
> DefaultHighlighter.DefaultHighlightPainter to highlight some text of a
> JEditPane.  The painter is created with a color that is the same as the
> JEditPane's selection color.
>
> On Windows, when using this painter, the highlight is drawn the correct color

> but with Java 1.5 the text is not inverted as it should be.  Under 1.4 the
> same code works fine.  The text in question is blue and is drawn using the
[quoted text clipped - 7 lines]
> Anyone have any idea what changed in 1.4 -> 1.5 to cause this?  Know of a
> fix?

I think I've solved my own problem.  Looks like the 1.5 code looks to see if
the painter is a DefaultHighlighter.DefaultHighlightPainter and does
something special to invert the text if it is.  Being a subclass isn't good
enough.  I was able to change my code to use the default
DefaultHighlighter.DefaultHighlightPainter and it is working again now.

Signature

Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.