🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: need help with JSlider event capture

#8161
From: Joi Ellis
Date: Wed, 18 Oct 2000 00:00
39 lines
2138 bytes
Audrey Seymour <audrey@ndtr.org> wrote:
> Hello all,

> I'm having trouble capturing the event of a JSlider drag ending.
> Although I copied the text from the java.sun.com tuturials on 
> sliders, which uses the following source clip in the ChangeListener
> in order to catch the last value selected with a slider,
> in a JBuilder 3.5 Foundation debug session, I never get
> a state change where the value is not adjusting.  However,
> I do get many state changes when the value is still adjusting.
> What's wrong here?

Did you add that object as a listener on the slider?  An obvious
question, but something I still forget to do quite often...

> =======================================================================
>   public void stateChanged(ChangeEvent e)
>   {
>     JSlider source = (JSlider)e.getSource();
>     if (!source.getValueIsAdjusting())
>     {
>       // I never get here!
>     }
>   }
> =======================================================================

There are numerous bug reports filed against JSlider and its handling
of events.  See:

http://search.java.sun.com/query.html?qt=%2Bcategory%3Ajava+%2BJSlider+1.2.2&col=obug&category=category%3Ajava&state=&query=JSlider+1.2.2&submit=+Search+

-- 
Joi Ellis                    Software Engineer
Aravox Technologies          joi@aravox.com, gyles19@visi.com

No matter what we think of Linux versus FreeBSD, etc., the one thing I
really like about Linux is that it has Microsoft worried.  Anything
that kicks a monopoly in the pants has got to be good for something.
           - Chris Johnson
Technical Details
Message-ID: <8sl2st$oh25@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39EE0FC2.EA6DE10A@ndtr.org>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,c4bec3bca5ad0a87
X-Google-Attributes: gid111d45,public
From: Joi Ellis <joi@joi.aravox.com>
Subject: Re: need help with JSlider event capture
Date: 2000/10/18
Message-ID: <8sl2st$oh25@bornews.borland.com>
X-Deja-AN: 683054885
References: <39EE0FC2.EA6DE10A@ndtr.org>
Organization: Another Netscape Collabra Server User
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i686))
Newsgroups: borland.public.jbuilder.java.swing