Similar question ,但不完全相同。
table.showColumn()
很有帮助,但是滚动只有列宽的粒度。但我想要更精确地控制滚动位置。
考虑以下用例。我有两个表,我知道它们具有相同的宽度和相同的列宽。我想实现某种滚动同步器,以便当用户滚动一个表(水平)时,另一个表滚动到相同的位置。
编辑:
On the Eclipse forum似乎有同样的问题和一些工作思路,但没有解决方案。
编辑: 我在 Windows 上发现了这种行为
最佳答案
ScrolledComposite
中的方法setOrigin(x,y)
应该有帮助:
Scrolls the content so that the specified point in the content is in the top left corner. If no content has been set, nothing will occur. Negative values will be ignored. Values greater than the maximum scroll distance will result in scrolling to the end of the scrollbar.
关于java - 以编程方式水平滚动 SWT 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4254168/