This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 16803 - JScrollPane should auto-scroll only if it is already positioned at its maximum position
Summary: JScrollPane should auto-scroll only if it is already positioned at its maximu...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: jrojcek
URL:
Keywords:
Depends on:
Blocks: 16010
  Show dependency tree
 
Reported: 2001-10-21 07:06 UTC by _ gtzabari
Modified: 2008-12-22 19:53 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
JAutoScrollBar (1.16 KB, text/plain)
2001-10-21 07:07 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2001-10-21 07:06:40 UTC
I'm interested in contributributing some of my code to the Netbeans team. 

Imagine the following scenerio:

We have a JTextArea/JTextPane/JList (etc) inside a JScrollPane. There are scenerios where we want to auto-scroll the JScrollPane. Right now, CVS | COMMIT 
does this.. As the list inside the JScrollPane grows longer, the scroll-pane automatically scrolls downward. I humbly suggest that my code improves upon the 
aforementioned concept.

My code will auto-scroll when the list/text grows longer *if and only if* the scroll-bar is already positioned at the end of the list. You get the effect of 
auto-scrolling but the JScrollPane doesn't steal focus away from the user if he decides to scroll back and examine some previous data. The current implementation 
used in Netbeans auto-scrolls no matter what; often stealing focus away from the user.

My code is attached. 
Usage is: JScrollPane.setVerticalScrollBar(myScrollBarCode);

Enjoy,

Gili
Comment 1 _ gtzabari 2001-10-21 07:07:35 UTC
Created attachment 3089 [details]
JAutoScrollBar
Comment 2 Jesse Glick 2001-10-22 08:42:17 UTC
Gili if you want this to be usable, it must have an SPL license notice
on it, and should also list you as a contributor. Thanks!
Comment 3 Chris Ledantec 2001-10-22 09:35:30 UTC
i'm assuming since this extends JScrollBar that it is accessible...
but please verify this. if we start to use custom components then we
need to be extra diligent that they meet the same accessibility
standard that the swing components do.

another minor point is that *if* we use this component one place then
it should be used all places or it will be confusing to the user that
some dialogs autoscroll always and others seem to stop if the scroll
position is changed.
Comment 4 _ gtzabari 2001-10-22 13:23:28 UTC
Jesse: SPL is fine with me, and I won't object to 
being listed as a contributor :)

Chris: I don't understand your accessibility 
question. Are you refering to what happens if we 
use setEnabled(false) or this component? As far as 
I know, it'll still auto-scroll but the user will 
be unable to manually modify its position. As for 
adhering to Swing accessiblity standards I don't 
think we break anything here (where do I read about 
the standards?). Lastly, there are very few places 
in Netbeans were you actually *want* auto-scroll. 
This is only useful in cases where you're 
auto-generate a listing in real-time. Might be 
useful for logs or (most notably) for the 
output-window. In fact, this would be *great* for 
the output window!! :)
Comment 5 Jan Zajicek 2001-10-23 15:50:08 UTC
CCing Chris - to consult the UI and accessibility stuff. Also CCing
Ales - owner of OW.
Comment 6 Jan Chalupa 2001-11-27 11:51:48 UTC
Target milestone -> 3.3.1.
Comment 7 Jan Chalupa 2001-11-27 11:55:24 UTC
Target milestone -> 3.3.1.
Comment 8 Jan Chalupa 2002-01-11 14:00:37 UTC
Target milestone -> 3.4
Comment 9 Jan Chalupa 2002-01-11 14:04:58 UTC
Target milestone -> 3.4
Comment 10 Jan Chalupa 2002-01-11 14:06:33 UTC
Target milestone -> 3.4
Comment 11 Jan Chalupa 2002-01-11 14:10:14 UTC
Target milestone -> 3.4
Comment 12 Marek Grummich 2002-07-22 08:31:19 UTC
Target milestone was changed from '3.4' to TBD.
Comment 13 Marek Grummich 2002-07-22 08:36:40 UTC
Target milestone was changed from '3.4' to TBD.
Comment 14 Marian Mirilovic 2002-07-23 14:47:00 UTC
Chris, answer Gili's questions please, thanks in advance.
Comment 15 Chris Ledantec 2002-07-23 15:30:42 UTC
to answer: for accessibility questions take a look at
a11y.netbeans.org. there are several links that will help clarify what
needs to happen to be compliant. i think my comment came during a
major effort to get the entire ide up to standards -it may not be as
serious an issue as i made it out to be.
Comment 16 _ gtzabari 2003-01-14 20:07:47 UTC
Update:

JAutoScrollBar is useless. It turns out it doesn't work as designed (I
don't know what I was thinking) although the idea behind it is a good one.

I have tried fixing this implementation so it works for all scrollable
JTextComponents but it is proving to be incredibly difficult to
implement so for now I don't have a fix. If anyone is willing to help
me with this, please let me know. 

  
Comment 17 Chris Ledantec 2003-07-07 10:09:58 UTC
Jano, consider this in the window system work.
Comment 18 Marian Mirilovic 2005-11-08 15:15:07 UTC
I think it works this way now.