Article View: borland.public.jbuilder.java.swing
Article #8986Re: Jtextfield problem
From: Sven Goetgeluck
Date: Sat, 27 May 2000 00:00
Date: Sat, 27 May 2000 00:00
68 lines
3763 bytes
3763 bytes
Finaly found the solution to this annoying problem
thanks a lot both Paul and John to help me with this till the end
you want to see how the endresult is ???
greetings Sven
Paul Furbacher [TeamB] <pnf@home.com> schreef in berichtnieuws
392E038F.9915280A@home.com...
> Sven Goetgeluck wrote:
> >
> > Code [snipped]
>
> >Where do i put the actionmistener of the spinner in the
> Nemericeditfield do
> > it listens to reaction of the spinner?
>
> In your NumericEditControl, activate the Designer and click on
> the spinner object. Go to the "Events" tab of the Property Inspector.
> Triple-click on the "actionPerformed" event. When JBuilder takes
> you to the editor, write your code which handles the action command
> coming from the spinner.
>
> > how to add a listener to the frame so i can update other components in
the
> > frame , is this possible without the enter key????
>
> Once again, __implement__ the Adjustable interface. In the code
> you showed, you had only implemented a few of the methods. ***Use
> the "Implement interface" wizard.*** For most of the "set" methods
> in the interface, you can leave them empty for now.
>
> Then from the actionPerformed event handling you added above, you
> fire the adjustment event after either decrementing or incrementing.
>
> For the fireAdjustmentValueChanged(), addAdjustmentListener() and
> remove...() methods, STEAL them verbatim from JScrollbar. Just
> type in "JScrollBar sb = null;" anywhere in the editor, compile,
> and then select "JScrollBar" and "Browse Symbol". That will drill
> down into the JScrollBar class, and from there you can steal the
> necessary code. You don't have to change a word in these three
> methods. Steal the JavaDoc comments and change them to reflect
> your component, and maybe add a reminder in there that you stole
> this code. No big deal, but helps you remember where it came
> from.
>
>
> The following goes in the Frame, not in the Control. Your Frame is
> the listener, so it implements the AdjustmentListener interface or
> has a delegate implement it.
>
> > public void adjustmentValueChanged(AdjustmentEvent e) {
> > file://TODO: implement this java.awt.event.AdjustmentListener method;
> > }
>
> Oh, while you're at it, take out the "border1" related code. It's
> dead -- nothing uses "border1".
>
> By the way ... do you have a good reference book on Swing? It
> might be time to hunt around for one at your local technical
> bookstore. It's probably a good time to read up on events,
> implementing interfaces, etc. "Java In a Nutshell" (3rd edition
> by now) is one of my best friends. There are other books, though,
> and you should find one which you feel comfortable with.
>
>
> Paul Furbacher (TeamB)
Technical Details
Message-ID:
<392eb53d@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3921af12@dnews> <39230C94.3B09A3A0@home.com> <39242302@dnews> <MPG.138e6cabc7cff616989936@forums.borland.com> <39250aa2@dnews> <MPG.139148a8c31034b098993c@forums.borland.com> <392A7C85.7D72C823@officeline.be> <MPG.139505deb9177169989947@forums.borland.com> <392BEFE0.6249F1E8@officeline.be> <392C4CAD.2C8B800C@home.com> <392c5d2d@dnews> <MPG.1396a443467bdd02989954@forums.borland.com> <392D3672.C45A6D1F@home.com> <392d8347@dnews> <392E038F.9915280A@home.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,e3d8a7969574fa02 X-Google-Attributes: gid111d45,public From: "Sven Goetgeluck" <sven.goetgeluck@pandora.be> Subject: Re: Jtextfield problem Date: 2000/05/27 Message-ID: <392eb53d@dnews> X-Deja-AN: 627677492 References: <3921af12@dnews> <39230C94.3B09A3A0@home.com> <39242302@dnews> <MPG.138e6cabc7cff616989936@forums.borland.com> <39250aa2@dnews> <MPG.139148a8c31034b098993c@forums.borland.com> <392A7C85.7D72C823@officeline.be> <MPG.139505deb9177169989947@forums.borland.com> <392BEFE0.6249F1E8@officeline.be> <392C4CAD.2C8B800C@home.com> <392c5d2d@dnews> <MPG.1396a443467bdd02989954@forums.borland.com> <392D3672.C45A6D1F@home.com> <392d8347@dnews> <392E038F.9915280A@home.com> X-Trace: 26 May 2000 10:32:45 -0800, 195.130.150.5 X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: borland.public.jbuilder.java.swing X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200