Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to scroll using mouse wheel only on a parent scroll pane

806779Oct 30 2010 — edited Oct 31 2010
Hi guys,
Let's imagine a table. In each cell of the table stands a component surrounded by a JScrollPane. All the scoll panes are configured so that the scroll bar is visible only when necessary.
So, ALL the cells contain scroll panes but only a few of them actually show some scrollbar.
The whole table (which is very big) is also in a global scroll pane and is scrollable.

My problem:
I want to use the mouse wheel to scroll over the complete table. Since the table contain in all its cells scroll panes, the inner scrollpanes takes very quickly the focus and the global scroll stops immediately.
How can I force the mouse weel to take control ONLY on the global scroll pane? so basically do not forward the events to its inner components?

I tried to disable the mouse wheel on all the inner scroll panes:
xxx.setWheelScrollingEnabled(false);
... but it does not work.
Any idea?
This post has been answered by camickr on Oct 30 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2010
Added on Oct 30 2010
10 comments
468 views