🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #677

Re: Javahelp on JOptionPane

#677
From: John McGrath [TeamB]
Date: Fri, 14 Jan 2005 12:21
28 lines
2176 bytes
On 1/14/2005 at 3:03:40 AM, Bart Jourquin wrote:

> I use JavaHelp in my app to create a context sensitive help system. I've
> choosen to implement it by means of the "help" or "f1" key using
> HelpBroker.enableHelpKey method. This work perfectly well as long as I
> can have access to the component that has the focus.
> 
> How can I do it for JOptionPane.showXXX methods?

That is tough, because the showXxxxDialog() methods do not give you access
to the actual JOptionPane component.  In the showMessageDialog() case, if
you use a JComponent for a message, you can have it look at its parent,
but that does not work in other cases.

You can still use most of the functionality of JOptionPane, but instead of
using the showXxxxDialog() methods, create a JOptionPane component, create
the Dialog using the createDialog() method, and show that.  Basically, you
want to create your own showXxxxDialog() methods.  You can look at the
source code for those methods to see what needs to be done.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <xn0dx8mtugg593k003@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41e77cda$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,120ee6ce4cc4028f
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: Javahelp on JOptionPane
Newsgroups: borland.public.jbuilder.java.swing
References: <41e77cda$1@newsgroups.borland.com>
User-Agent: XanaNews/1.17.1.2
Message-ID: <xn0dx8mtugg593k003@newsgroups.borland.com>
X-Ref: newsgroups.borland.com ~XNS:00000128
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 141.151.11.96
Date: 14 Jan 2005 04:21:51 -0800
X-Trace: newsgroups.borland.com 1105705311 141.151.11.96 (14 Jan 2005 04:21:51 -0800)
Lines: 28
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail