Skip to main content

HelpBroker.enableHelp() not working as expected

5 replies [Last post]
Anonymous

Hi folks,
I am using the convenience methods in HelpBroker to enable Help on different components. I used enableHelp(jlabel,"top",helpSet) where "top" is a valid map-id, but when I clicked on jlabel nothing happened. I used enableHelpOnButton on a button and it worked. So does how does enableHelp on components other than button/menuItem work?
thanks a lot!

-jonathan

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

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.
[att1.html]

Reply viewing options

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

Jonathan Zhang wrote:

> Hi folks,
> I am using the convenience methods in HelpBroker to enable Help on
> different components. I used enableHelp(jlabel,"top",helpSet) where
> "top" is a valid map-id, but when I clicked on jlabel nothing happened.
> I used enableHelpOnButton on a button and it worked. So does how does
> enableHelp on components other than button/menuItem work?
> thanks a lot!

All enableHelp does is set the ID and the HelpSet for a given component.
enableHelpOnButton adds the activation code to show the help in the
HelpBroker.

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.

Jonathan Zhang

So what do I use to activate components that are not AbstractButton? like
JLabel,JPanel,etc
thanks!

-jonathan

----- Original Message -----
From: "Roger Brinkley"
To:
Sent: Friday, June 04, 2004 12:06 PM
Subject: Re: [JAVAHELP] HelpBroker.enableHelp() not working as expected

> Jonathan Zhang wrote:
>
> > Hi folks,
> > I am using the convenience methods in HelpBroker to enable Help on
> > different components. I used enableHelp(jlabel,"top",helpSet) where
> > "top" is a valid map-id, but when I clicked on jlabel nothing happened.
> > I used enableHelpOnButton on a button and it worked. So does how does
> > enableHelp on components other than button/menuItem work?
> > thanks a lot!
>
> All enableHelp does is set the ID and the HelpSet for a given component.
> enableHelpOnButton adds the activation code to show the help in the
> HelpBroker.
>
> 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.

Roger Brinkley

Jonathan Zhang wrote:

> So what do I use to activate components that are not AbstractButton? like
> JLabel,JPanel,etc
> thanks!

Well you can't push a label or a panel so how are trying to activate
help from them?

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.

Jonathan Zhang

Ok so activate help might not be the right word to use. The affect that I m
trying to achieve is this: when the user clicks on a JLabel, the
corresponding help content is displayed in the help viewer. I guess I can
catch the ActionEvent from click, and then tells the viewer to display the
content with some map-id. But is there a better way?
thanks

-jonathan
----- Original Message -----
From: "Roger Brinkley"
To:
Sent: Friday, June 04, 2004 12:32 PM
Subject: Re: [JAVAHELP] HelpBroker.enableHelp() not working as expected

> Jonathan Zhang wrote:
>
> > So what do I use to activate components that are not AbstractButton?
like
> > JLabel,JPanel,etc
> > thanks!
>
> Well you can't push a label or a panel so how are trying to activate
> help from them?
>
> 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.

Roger Brinkley

Jonathan Zhang wrote:

> Ok so activate help might not be the right word to use. The affect that I m
> trying to achieve is this: when the user clicks on a JLabel, the
> corresponding help content is displayed in the help viewer. I guess I can
> catch the ActionEvent from click, and then tells the viewer to display the
> content with some map-id. But is there a better way?
> thanks

Sound like you want "What's this" help or what we call field level help.
You're on the right track. Do what you did then add the following:

JToolBar toolbar=new JToolBar();
. . .
helpbutton= addButton(toolbar, "images/help.gif", "help");
helpbutton.addActionListener(
new CSH.DisplayHelpAfterTracking (mainHS,
"javax.help.Popup",
null));

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.