开发者

SWT ScrolledComposite cutting off information.

开发者 https://www.devze.com 2022-12-31 14:39 出处:网络
I\'m making an application tha开发者_C百科t has many lines of data coming back from a Database stub(which will become an Oracle database), and for some reason the scroll bar stops at about the 500th e

I'm making an application tha开发者_C百科t has many lines of data coming back from a Database stub(which will become an Oracle database), and for some reason the scroll bar stops at about the 500th element. I'm wondering if there's anyway to have all the elements show within the scroll bar.


I'm assuming here that you're using Windows, because there is a fairly general problem with scrollbars on Windows: the maximum value is a short int, 32,768. Therefore, if the height of the inner composite of a ScrolledComposite is greater than 32,768 pixels, the composite will be clipped.

I haven't found a robust way of fixing this, but there is a workaround: separate the scrollbar from the composite that you wish to scroll. You can't create a ScrollBar, but you can make a ScrolledComposite that is precisely as wide as a ScrollBar, then attach a ScrollListener to it and have it adjust the layout position of the scrolling composite.

Somewhere I have a snippet, but I'm not even exactly sure if this diagnosis applies to your scenario.


You might need to set the minimum and maximum values of the ScrollBar. You would use the setMinimum() and setMaximum() methods, respectively.

It's also a good idea to set the page increment. This is the number of scroll lines that the selected value changes by when the user clicks the area between the thumb and the arrow buttons, or presses the Page Up or Page Down buttons. You would use the setPageIncrement() method.

Finally, Oracle may impose a maximum number of rows you can retrieve from a table. I believe the default is 500 rows.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号