🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

basic jTextField question

#8348
From: Scott Howes
Date: Sat, 23 Sep 2000 00:00
12 lines
1019 bytes
I am trying to change the text in a textField when a button is pressed but
keep getting a variety of errors.  What do I need to do. TIA.

    if (jTextField1 = " ")
    jTextField1.setText("Add Text");  // incompatible types

    if (jTextField1.getText() = "")
    jTextField1.setText("Add Text");  // variable required but found

Just setting the buttonClick event to the setText method without using an if
statement works but I am trying to change the text depending upon the value
in the jTextField1 when the button is clicked.
Technical Details
Message-ID: <39cd626b_2@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,20f5a1ffaf32e238,start
X-Google-Attributes: gid111d45,public
From: "Scott Howes" <sdhowes@aol.com>
Subject: basic jTextField question
Date: 2000/09/23
Message-ID: <39cd626b_2@dnews>
X-Deja-AN: 673388852
X-Trace: 23 Sep 2000 19:09:47 -0800, 172.145.85.37
X-MSMail-Priority: Normal
X-Priority: 3
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200