Skip to main content

[JAVAHELP] Marked words in search-query?

6 replies [Last post]
Anonymous

When searching for a word (in hsviewer) and get some hits on a page, each
word get marked with a blue color on the page that it was found in.
I wonder how to change that color?
I want to set it to a yellow color that is more appropiate I think.
Do I have to edit the Java code or is it some parameter I can set somewhere?

Thank you!

Per Lundkvist

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
David Cagle

We have been told a fix is in 1.4.1_06 and 1.4.2_02. The fix was originally slated for 1.4.1_05 but it appears it didn't make it.

Sun BugID is 4761990.

-----Original Message-----
From: Roger Brinkley [mailto:Roger.Brinkley@SUN.COM]
Sent: Wednesday, October 01, 2003 10:17 AM
To: JAVAHELP-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVAHELP] Marked words in search-query?

Raja Kannappan wrote:
> I think the bug is in JDK. I saw this line in windowslookandfeel.java
> (jdk 1.4) in initSystemColorDefaults() function.
>
> "textHighlight", "#000080", /* Text background color when selected */
>
> This is set to blue here. It needs to be changed there.
>
> So, as a workaround we override it in our code.
>

As I remember the bug is fixed in recent release of the JDK (one of the _xx releases).

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and "SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Raja Kannappan

I think the bug is in JDK. I saw this line in windowslookandfeel.java
(jdk 1.4) in initSystemColorDefaults() function.

"textHighlight", "#000080", /* Text background color when selected */

This is set to blue here. It needs to be changed there.

So, as a workaround we override it in our code.

- Raja.

-----Original Message-----
From: David Fowler [mailto:dlfowler1@HOTMAIL.COM]
Sent: Wednesday, October 01, 2003 8:46 AM
To: JAVAHELP-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVAHELP] Marked words in search-query?

I found this workaround in either JAVAHELP-INTEREST or the Java Forums a
while back - it works for me:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
defaults = UIManager.getDefaults();
origHlightColor =
(Color)defaults.get("EditorPane.selectionBackground");
defaults.put("EditorPane.selectionBackground",new
Color(204,204,255));

After you instantiate your help viewer (e.g. JHelp, DefaultHelpBroker),
you
can (should) reset the "EditorPane.selectionBackground" back to
"origHlightColor".

I don't remember what the exact cause of this bug is.

Dave

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus

************************************************************************
********

You may leave the list at any time by sending message with no subject
and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM.
Archives
are available at
http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Roger Brinkley

Raja Kannappan wrote:
> I think the bug is in JDK. I saw this line in windowslookandfeel.java
> (jdk 1.4) in initSystemColorDefaults() function.
>
> "textHighlight", "#000080", /* Text background color when selected */
>
> This is set to blue here. It needs to be changed there.
>
> So, as a workaround we override it in our code.
>

As I remember the bug is fixed in recent release of the JDK (one of the
_xx releases).

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Raja Kannappan

You need to do this before setting the look and feel:

UIManager.put("EditorPane.selectionBackground",Color.lightGray);

If you want you can change lightGray to yellow.

- Raja.

-----Original Message-----
From: Roger Brinkley [mailto:Roger.Brinkley@SUN.COM]
Sent: Wednesday, October 01, 2003 8:46 AM
To: JAVAHELP-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVAHELP] Marked words in search-query?

Per Lundkvist wrote:
> When searching for a word (in hsviewer) and get some hits on a page,
each
> word get marked with a blue color on the page that it was found in.
> I wonder how to change that color?
> I want to set it to a yellow color that is more appropiate I think.
> Do I have to edit the Java code or is it some parameter I can set
somewhere?

It's a swing setting. I beleive it is the text highlight color and is
setable in the Swing UIManager tables.

Binky

************************************************************************
********

You may leave the list at any time by sending message with no subject
and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM.
Archives
are available at
http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

David Fowler

I found this workaround in either JAVAHELP-INTEREST or the Java Forums a
while back - it works for me:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
defaults = UIManager.getDefaults();
origHlightColor =
(Color)defaults.get("EditorPane.selectionBackground");
defaults.put("EditorPane.selectionBackground",new
Color(204,204,255));

After you instantiate your help viewer (e.g. JHelp, DefaultHelpBroker), you
can (should) reset the "EditorPane.selectionBackground" back to
"origHlightColor".

I don't remember what the exact cause of this bug is.

Dave

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Roger Brinkley

Per Lundkvist wrote:
> When searching for a word (in hsviewer) and get some hits on a page, each
> word get marked with a blue color on the page that it was found in.
> I wonder how to change that color?
> I want to set it to a yellow color that is more appropiate I think.
> Do I have to edit the Java code or is it some parameter I can set somewhere?

It's a swing setting. I beleive it is the text highlight color and is
setable in the Swing UIManager tables.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.