Article View: borland.public.jbuilder.java.api
Article #1158about the jTextField
From: Zhilei Ma
Date: Wed, 17 Apr 2002 12:45
Date: Wed, 17 Apr 2002 12:45
18 lines
1423 bytes
1423 bytes
hi all
i have a jTextField and a jButton im my programm. i want to make the jButton
disable, when the jTextField is empty. the codes are follows:
void jTextField2_keyPressed(KeyEvent e) {
if ( jTextField2.getText().equals( "" ) )
jButton1.setEnabled( false );
else
jButton1.setEnabled( true );
}
but when i have inputed a charactor in the jTextField, the jButton is still
unusable, until i have inputed the second charator. how can i make it just
like i have hoped?
regrads
Zhilei Ma
Technical Details
Message-ID:
<3cbd6e03$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,abe9249321e673dd,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-04-17 05:49:13 PST Reply-To: "Zhilei Ma" <zhilei.ma@iao.fhg.de> From: "Zhilei Ma" <zhilei.ma@iao.fhg.de> Newsgroups: borland.public.jbuilder.java.api Subject: about the jTextField Date: Wed, 17 Apr 2002 14:45:38 +0200 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 137.251.48.170 Message-ID: <3cbd6e03$1_1@dnews> X-Trace: dnews 1019047427 137.251.48.170 (17 Apr 2002 05:43:47 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews