Article View: borland.public.jbuilder.java.swing
Article #10594Re: jtextfield problem
From: Lois Neo
Date: Mon, 30 Aug 1999 00:00
Date: Mon, 30 Aug 1999 00:00
33 lines
1369 bytes
1369 bytes
use this check: if (textField.getText().length() == 0) You can also eliminate the all-blank spaces by trimming: if (textField.getText().trim().length() == 0) hope it helps. -- Lois raj <rahulgulati@hotmail.com> wrote in message news:37c88258.0@209.66.99.126... > > hi > i have a jtextfield and a submit button > if the jtextfield is left blank, and the submit button is hit, > then it should pop up a message box indicating "blank field" > now my question is > how to check if the jtextfield is blank > > i m trying if(jtextfield.getText() == "") > but its not working > > can anyone please help me out > > thanx > raj > > > > -----------------** -- Posted from CodeGuru -- **----------------- > http://www.codeguru.com/java The website for Java programmers. > >
Technical Details
Message-ID:
<7qdte0$5rh7@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37c88258.0@209.66.99.126>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,6c48425efbd7acbe X-Google-Attributes: gid111d45,public From: "Lois Neo" <slneo@cybergal.com> Subject: Re: jtextfield problem Date: 1999/08/30 Message-ID: <7qdte0$5rh7@forums.borland.com> X-Deja-AN: 518845423 References: <37c88258.0@209.66.99.126> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Reply-To: "Lois Neo" <slneo@cybergal.com> Newsgroups: borland.public.jbuilder.java.swing