🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JScrollbar event problem

#11181
From: Tor Iver Wilhelmsen
Date: Tue, 06 Jul 1999 00:00
26 lines
1204 bytes
"Marcel van den Dungen" <info@c-content.nl> writes:

> i'm having a problem when using the jscrollbar. whenever the end-user
> interacts with the jscrollbar a statechanged is fired. but when i manipulate
> the jscrollbar myself (e.g by using a setvalue call) the statechanged is
> also fired. can anyone please tell me how to go aroud this second firing?

in the component:

   public boolean ignoreChange = false;

   // ...

   ignoreChange = true;
   setValue
   ignoreChange = false;
   

In the listener:

   public void stateChanged(ChangeEvent evt) {
     if (component.ignoreChange) return;
   }

Note: This does not take into account such things as the user
manipulating the scrollbar while this is going on.
Technical Details
Message-ID: <uemim5hdf.fsf@sds.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7lscqn$bi320@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,46361046639a4122
X-Google-Attributes: gid111d45,public
From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no>
Subject: Re: JScrollbar event problem
Date: 1999/07/06
Message-ID: <uemim5hdf.fsf@sds.no>
X-Deja-AN: 497676072
Sender: towi@SDSA1761
References: <7lscqn$bi320@forums.borland.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing