Skip to main content

Closing the help window with ESC key

1 reply [Last post]
Anonymous

Binky, we have some developers asking why the help window does not close when the ESC key is pressed.
Searching through the archives I came across a nice suggestion from Mr. Schlecht.

Basically he said that we should get access to the frame in which the online help is displayed
and add a KeyListener.
http://archives.java.sun.com/cgi-bin/wa?A2=ind0205&L=javahelp-interest&P...

Then I noticed your post about V2.0 and deprecating the JFrame frame variable! Shame, shame!
http://archives.java.sun.com/cgi-bin/wa?A2=ind0211&L=javahelp-interest&D...

Could this be a candidate for enhancement in the next release or is it too late for that?

Any other suggestions would be appreciated :)

----------------------------------------
David Cagle

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

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.
Roger Brinkley

David Cagle wrote:

> Binky, we have some developers asking why the help window does not
> close when the ESC key is pressed. Searching through the archives I
> came across a nice suggestion from Mr. Schlecht.
>
> Basically he said that we should get access to the frame in which the
> online help is displayed and add a KeyListener.
> http://archives.java.sun.com/cgi-bin/wa?A2=ind0205&L=javahelp-interest&P...
>
>
> Then I noticed your post about V2.0 and deprecating the JFrame frame
> variable! Shame, shame!

The change in the design required the deprecation. It should have never
been made available in the first place. One of my weak moments to a
users request. In reality the unstable nature of the frame given modal
dialogs made it such that you can't depend on it being there or not.

>
>
> Could this be a candidate for enhancement in the next release or is
> it too late for that?

If you mean making the JFrame available, absolutely not. Not an option,
shouldn't have been done in the first place. If you mean the escape key
then it would be a consideration, but probably not for the next release
but the one after that.

> Any other suggestions would be appreciated :)

You can get the window through the WindowPresentation. Of course the
Frame can change on you depending on modals but that would be your
problem to manage.

Otherwise you can write your own HelpBroker or JFrame and handle all the
work yourself.

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.