Article View: borland.public.jbuilder.java.language
Article #14535Re: jtextfield problem
From: Dietmar Schinnerl
Date: Mon, 30 Aug 1999 00:00
Date: Mon, 30 Aug 1999 00:00
33 lines
1683 bytes
1683 bytes
As there is no operator-overloading in Java you get only true with == if
you compare an object with itself. So you have to use the equals method
if(jTextField1.getText().equals(""))
raj wrote:
>
> 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.
--
___________________________________________________________________
Dietmar Schinnerl tel: +43 316 82 26 32 - 13
HS-ART Digital Service GmbH mobil: +43 676 57 22 000
Rechbauerstr. 37 fax: +43 316 82 64 44
A-8010 Graz e: schinnerl.hsart@aon.at
___________________________________________________________________
Technical Details
Message-ID:
<37CAA8F7.52E52F95@aon.at>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37c882da.0@209.66.99.126>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,3237abfe2ae61d6a X-Google-Attributes: gidf74b3,public From: Dietmar Schinnerl <schinnerl.hsart@aon.at> Subject: Re: jtextfield problem Date: 1999/08/30 Message-ID: <37CAA8F7.52E52F95@aon.at> X-Deja-AN: 518911422 Content-Transfer-Encoding: 7bit References: <37c882da.0@209.66.99.126> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language