🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: ibm.software.vajava.beans
Article #13

JTextField in VCE

#13
From: Daniel Faensen
Date: Fri, 12 Apr 2002 10:52
27 lines
2575 bytes
How do I synchronize String properties of my model bean (e.g., the Name of a
Customer) with the contents of a JTextField most elegantly. I prefer to work
with the VAJ Visual Composision Editor.

With AWT's TextField that was easy: Just connect the text property of the
TextField to the Name property of the Customer and VCE generates the code
for you.

I tried to tear off the document property of JTextField and connect its
document event to the Customer's Name property. The value of this connection
I connected to the text property of the JTextField.
While this perfectly updates the Customer Name changing the Name is not
reflected in the JTextField.

Is it necessary to create a third connection from the Customer Name to the
text field? That clutters the VCE screen with lots of connections.
Additionally, I get IllegalStateExceptions thrown by
AbstractDocument.writeLock(). I suppose the latter can be avoided by
introducing a flag that prevents circular updates. With TextField
property-to-property connections VAJ exactly does this.

Does anyone know an elegant way performing this in VCE. Application of the
QuickForm feature would be great. Or do I need to code everything myself?

Thank you for your suggestions

Daniel Faensen
Technical Details
Message-ID: <a96e56$1era$1@news.boulder.ibm.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!easynews!news-xfer.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!news.software.ibm.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114aa0,6cd90e39f400a0fd,start
X-Google-Attributes: gid114aa0,public
X-Google-Thread: 109b1c,6cd90e39f400a0fd,start
X-Google-Attributes: gid109b1c,public
X-Google-Thread: fed75,6cd90e39f400a0fd,start
X-Google-Attributes: gidfed75,public
X-Google-ArrivalTime: 2002-04-12 04:14:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!easynews!news-xfer.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!news.software.ibm.com!not-for-mail
From: "Daniel Faensen" <faensen@inf.fu-berlin.de>
Newsgroups: ibm.software.vajava.beans,ibm.software.vajava.ide,ibm.software.vajava.language
Subject: JTextField in VCE
Date: Fri, 12 Apr 2002 12:52:04 +0200
Organization: IBM News Server
Lines: 29
Message-ID: <a96e56$1era$1@news.boulder.ibm.com>
NNTP-Posting-Host: vaccine.rki.de
X-Trace: news.boulder.ibm.com 1018608614 47978 193.175.81.60 (12 Apr 2002 10:50:14 GMT)
X-Complaints-To: mattgar@us.ibm.com, tlew@us.ibm.com
NNTP-Posting-Date: 12 Apr 2002 10:50:14 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200