Thread View: borland.public.jbuilder.java.swing
3 messages
3 total messages
Started by Bart Jourquin
Fri, 14 Jan 2005 08:03
Javahelp on JOptionPane
Author: Bart Jourquin
Date: Fri, 14 Jan 2005 08:03
Date: Fri, 14 Jan 2005 08:03
27 lines
1679 bytes
1679 bytes
Hi all,
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?
Example for a simple plaf chooser:
String selectedValue = (String) JOptionPane.showInputDialog(null,
"Look & Feel to use:",
APPNAME,
JOptionPane.INFORMATION_MESSAGE, null, lfNames,
lfNames[currentLFIndex]);
if (selectedValue != null) {
...
{
How can I associate a HelpBroker.enableHelpKey(...) on such a pane?
Many thanks
Bart
Re: Javahelp on JOptionPane
Author: John McGrath [TeamB]
Date: Fri, 14 Jan 2005 12:21
Date: Fri, 14 Jan 2005 12:21
28 lines
2176 bytes
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
Re: Javahelp on JOptionPane
Author: Bart Jourquin
Date: Fri, 14 Jan 2005 13:11
Date: Fri, 14 Jan 2005 13:11
27 lines
2271 bytes
2271 bytes
Thanks. This is what I was trying here now, but I was hoping that there was a more simple way... Bart John McGrath [TeamB] wrote: > 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. >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads