Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #4699

Re: fighting over the scroller

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.gui
Subject Re: fighting over the scroller
Date 2011-09-22 18:34 -0700
Organization Canadian Mind Products
Message-ID <39on775rg5cjeh3cpcsj2aihubr90k008n@4ax.com> (permalink)
References <ucsh77pf9v4eoo7o8jjjoqrdt4ptjpg4fm@4ax.com> <nospam-30920C.19151020092011@news.aioe.org> <1c0j779arr138ua3kr50ed1ju8u5jm0of3@4ax.com> <nospam-B769B2.13413722092011@news.aioe.org>

Show all headers | View raw


On Thu, 22 Sep 2011 13:41:37 -0400, "John B. Matthews"
<nospam@nospam.invalid> wrote, quoted or indirectly quoted someone who
said :

>One convenient approach is to condition the property in an 
>AdjustmentListener:
>
>    public void adjustmentValueChanged(AdjustmentEvent e) {
>        isAutoScroll = !e.getValueIsAdjusting();
>    }

Thanks.  I added that at the application level and it worked fine,
even without timers.  As soon as I let go of the scroller it takes off
running automatically again.

 scroller.getVerticalScrollBar().addAdjustmentListener( new
AdjustmentListener()
        {
        /**
         * detect user fiddling with the scroller
         */
        public void adjustmentValueChanged( AdjustmentEvent e )
            {
            userBusyScrolling = e.getValueIsAdjusting();
            }
        } );
        
The only mildly tricky part was trying to find out where I could do an
addAdjustmentListener.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
It should not be considered an error when the user starts something
already started or stops something already stopped. This applies
to browsers, services, editors... It is inexcusable to 
punish the user by requiring some elaborate sequence to atone,
e.g. open the task editor, find and kill some processes.

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

fighting over the scroller Roedy Green <see_website@mindprod.com.invalid> - 2011-09-20 13:51 -0700
  Re: fighting over the scroller "John B. Matthews" <nospam@nospam.invalid> - 2011-09-20 19:15 -0400
    Re: fighting over the scroller Roedy Green <see_website@mindprod.com.invalid> - 2011-09-20 23:21 -0700
      Re: fighting over the scroller "John B. Matthews" <nospam@nospam.invalid> - 2011-09-22 13:41 -0400
        Re: fighting over the scroller Roedy Green <see_website@mindprod.com.invalid> - 2011-09-22 18:34 -0700
          Re: fighting over the scroller "John B. Matthews" <nospam@nospam.invalid> - 2011-09-22 23:26 -0400

csiph-web