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.
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
Created attachment 3089 [details] JAutoScrollBar
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!
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.
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!! :)
CCing Chris - to consult the UI and accessibility stuff. Also CCing Ales - owner of OW.
Target milestone -> 3.3.1.
Target milestone -> 3.4
Target milestone was changed from '3.4' to TBD.
Chris, answer Gili's questions please, thanks in advance.
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.
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.
Jano, consider this in the window system work.
I think it works this way now.