🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10594

Re: jtextfield problem

#10594
From: Lois Neo
Date: Mon, 30 Aug 1999 00:00
33 lines
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-mail
References: <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