title: How to make nested JScrollPanes work correctly?
body: <p><a href="https://i.stack.imgur.com/8mKw8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8mKw8.png" alt="enter image description here"></a></p>
  
  <p>As the image shows, I have two JScrollPanes, A and B. What I want to achieve is, when the cursor is over B, and you scroll the mouse wheel:</p>
  
  <p>1) If B has scrollable contents, just scroll B. </p>
  
  <p>2) If B is scrolled to the end already, or B has very few contents that it's not scrollable, scroll A.</p>
  
  <p>What happens now is that the mouse wheel event is always consumed by B no matter what, so A could never be scrolled. Any advice? Thanks in advance.</p>