Thread View: borland.public.jbuilder.java.swing
5 messages
5 total messages
Started by jinxiaojin
Wed, 24 Mar 2004 00:53
how to set cancel button and help(F1)?
Author: jinxiaojin
Date: Wed, 24 Mar 2004 00:53
Date: Wed, 24 Mar 2004 00:53
6 lines
1189 bytes
1189 bytes
As you know,it is simply to set up a default key(reacting to Enter being pressed) and a cancel key (reacting to ESC being pressed))in dephi. I know how to set up default button in java,But I do not know how to set up a cancel button and help button(reacting to F1 being pressed) . I found Jbuilder's UI can do it. Somebody can tell me how to do it? thanks.
Re: how to set cancel button and help(F1)?
Author: Roel
Date: Wed, 24 Mar 2004 14:08
Date: Wed, 24 Mar 2004 14:08
22 lines
1637 bytes
1637 bytes
Hi, You have to use keylisteners. A good resource is: http://www.rz.fhtw-berlin.de/javakurs/magelang/awt/sec03-events.html Regards, Roel jinxiaojin wrote: > As you know,it is simply to set up a default key(reacting to Enter being pressed) and a cancel key (reacting to ESC being pressed))in dephi. > I know how to set up default button in java,But I do not know how to set up a cancel button and help button(reacting to F1 being pressed) . > I found Jbuilder's UI can do it. > Somebody can tell me how to do it? > thanks. >
Re: how to set cancel button and help(F1)?
Author: jinxiaojin
Date: Thu, 25 Mar 2004 02:01
Date: Thu, 25 Mar 2004 02:01
33 lines
1820 bytes
1820 bytes
Thanks for your repsponse. I know this way,and I think it is inconvenient. In fact,java give a simple method to proccess enter key. the following code can process enter key. this.getRootPane().setDefaultButton(btn); I think there should be a simple way to process ese and f1. Roel <rgillesen_remove@yahoo.com> wrote: >Hi, > >You have to use keylisteners. > >A good resource is: >http://www.rz.fhtw-berlin.de/javakurs/magelang/awt/sec03-events.html > >Regards, > >Roel > > > > >jinxiaojin wrote: > >> As you know,it is simply to set up a default key(reacting to Enter being pressed) and a cancel key (reacting to ESC being pressed))in dephi. >> I know how to set up default button in java,But I do not know how to set up a cancel button and help button(reacting to F1 being pressed) . >> I found Jbuilder's UI can do it. >> Somebody can tell me how to do it? >> thanks. >> >
Re: how to set cancel button and help(F1)?
Author: jinxiaojin
Date: Thu, 25 Mar 2004 02:01
Date: Thu, 25 Mar 2004 02:01
33 lines
1820 bytes
1820 bytes
Thanks for your repsponse. I know this way,and I think it is inconvenient. In fact,java give a simple method to proccess enter key. the following code can process enter key. this.getRootPane().setDefaultButton(btn); I think there should be a simple way to process ese and f1. Roel <rgillesen_remove@yahoo.com> wrote: >Hi, > >You have to use keylisteners. > >A good resource is: >http://www.rz.fhtw-berlin.de/javakurs/magelang/awt/sec03-events.html > >Regards, > >Roel > > > > >jinxiaojin wrote: > >> As you know,it is simply to set up a default key(reacting to Enter being pressed) and a cancel key (reacting to ESC being pressed))in dephi. >> I know how to set up default button in java,But I do not know how to set up a cancel button and help button(reacting to F1 being pressed) . >> I found Jbuilder's UI can do it. >> Somebody can tell me how to do it? >> thanks. >> >
Re: how to set cancel button and help(F1)?
Author: Lori M Olson (TeamB)
Date: Thu, 25 Mar 2004 04:18
Date: Thu, 25 Mar 2004 04:18
35 lines
2211 bytes
2211 bytes
jinxiaojin wrote:
> Thanks for your repsponse.
> I know this way,and I think it is inconvenient.
> In fact,java give a simple method to proccess enter key.
> the following code can process enter key.
> this.getRootPane().setDefaultButton(btn);
>
> I think there should be a simple way to process ese and f1.
>
If you define an Action for "Esc", and an Action for "F1", then you can
assign these actions to the specific buttons using the
"configurePropertiesFromAction( Action a )" method.
I think that's as close to simple as you are going to get.
--
Regards,
Lori Olson (TeamB)
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
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