 <p>You should add the mouse listener to the JScrollPane's view instead of to the scroll pane itself, since the scroll pane consists of only corners and scroll bars.</p> <pre><code>yourJScrollPane.getViewport().getView().addMouseListener(yourMouseListener); </code></pre> <p>This code segment will add your mouse listener to the JScrollPane's one viewport component.</p>