Article View: borland.public.jbuilder.java.swing
Article #620Re: Disable a button??
From: Davisote
Date: Sat, 26 Mar 2005 01:10
Date: Sat, 26 Mar 2005 01:10
43 lines
2041 bytes
2041 bytes
hi.
Sorry, but this event doesn't work at all.
Regards
"Lori M Olson [TeamB]" <javadragon@techie.com> escribi๏ฟฝ en el mensaje
news:424489a2@newsgroups.borland.com...
> Davisote wrote:
>
>> Hi.
>> This should be the same code to disable the button, but sometimes
>> For example, if I delete all the text the button doesn't disable
>>
>> void jTextField1_keyPressed(KeyEvent e) {
>> if (jTextField1.getText().length() > 0) {
>> jButton1.setEnabled(true);
>> }
>> else {
>> jButton1.setEnabled(false);
>> }
>> }
>>
>
> Try using a keyTyped event instead of a keyPressed.
>
> --
>
> 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
Technical Details
Message-ID:
<4244b66c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42441118@newsgroups.borland.com> <4244454a$1@newsgroups.borland.com> <42445a44@newsgroups.borland.com> <424489a2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,cb273dd3cca84955 X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII From: "Davisote" <yeses@hotmail.com> Newsgroups: borland.public.jbuilder.java.swing References: <42441118@newsgroups.borland.com> <4244454a$1@newsgroups.borland.com> <42445a44@newsgroups.borland.com> <424489a2@newsgroups.borland.com> Subject: Re: Disable a button?? Date: Sat, 26 Mar 2005 01:10:11 -0000 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 80.103.163.72 Message-ID: <4244b66c@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1111799404 80.103.163.72 (25 Mar 2005 17:10:04 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail