Problem with invoking the javahelp from menuitem for multilanguage support

Priyanka AGARWAL

Usenet Archive
Joined
May 24, 2004
Messages
17
Reaction score
0
Hi,

I am using the following code to invoke the javahelp from my application.
The code works fine

if (language is english){
sz_help_file_name = p_buf_application.get_sz_help_file_location + java.io.File.separator + "english"; URL hsURL = new URL ("jar:file:" + sz_help_file_name + java.io.File.separator + "Campbell.jar!/Campbell.hs"); hs1 = new HelpSet(null, hsURL); hb1 = hs1.createHelpBroker("introduction_htm"); hb1.enableHelp(mnu_help_topics, "introduction_htm", hs1);// Menu item hb1.enableHelpKey(getRootPane, "introduction_htm", hs1);//F1 key

ActionListener helper = new CSH.DisplayHelpFromSource(hb1); mnu_help_topics.addActionListener(helper); }else{ // same code for french but the helpset is different }

Based on the language I am creating the helpBroker.
And invoking this function on change language functionality. So whenever language is changed this piece of code is called.

But I have a problem when I want to switch between language from my GUI. Based on then language selected the help should also change.

I have created two helpsets for french and english.
The problem is with the menu item when I switch between language the application crashes but it works fine with F1 key.

I am getting the following error message when I change the language and click on the help Topics menu item.

javax.help.InvalidHelpSetContextException: Wrong context at javax.help.DefaultHelpModel.setCurrentID(DefaultHelpModel.java:122) at javax.help.DefaultHelpModel.setCurrentID(DefaultHelpModel.java:95) at javax.help.Presentation.setCurrentID(Presentation.java:142) at javax.help.DefaultHelpBroker.setCurrentID(DefaultHelpBroker.java:339)

at javax.help.CSH.displayHelp(CSH.java:748)
at javax.help.CSH.access$200(CSH.java:80)
at javax.help.CSH$DisplayHelpFromSource.actionPerformed(CSH.java:1668) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
86)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra ctButton.java:1839) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel ..java:420) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258 ) at javax.swing.AbstractButton.doClick(AbstractButton.java:289) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1
113)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseRelease d(BasicMenuItemUI.java:943) at java.awt.Component.processMouseEvent(Component.java:5100) at java.awt.Component.processEvent(Component.java:4897) at java.awt.Container.processEvent(Container.java:1569) at java.awt.Component.dispatchEventImpl(Component.java:3615) at java.awt.Container.dispatchEventImpl(Container.java:1627) at java.awt.Component.dispatchEvent(Component.java:3477) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483 ) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128) at java.awt.Container.dispatchEventImpl(Container.java:1613) at java.awt.Window.dispatchEventImpl(Window.java:1606) at java.awt.Component.dispatchEvent(Component.java:3477) at java.awt.EventQueue.dispatchEvent(EventQueue.java:456) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh read.java:201) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre ad.java:151) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Is there a solution?
Thanks
Priyanka
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,245
Members
248,133
Latest member
DujonT

Latest Threads

Top