MouseWheelListener doesn't work - Java
<p>I am trying to catch mouse wheel event with no success. This is my main class:</p>

<pre><code>import java.awt.Dimension;
import javax.swing.JFrame;

public class Main extends JFrame {

    public Main() {
        Panel pan = new Panel();
        add(pan);
    }



    public static void main(String[] args) {

        Main wnd = new Main(); 

        wnd.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
        wnd.setPreferredSize(new Dimension(500, 500));
        wnd.pack();
        wnd.setVisible(true);

    }

}
</code></pre>

<p>and this is JPanel class which implements the mouse wheel listener:</p>

<pre><code>import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;

import javax.swing.JPanel;

public class Panel extends JPanel implements MouseWheelListener {

    public Panel() {
        // TODO Auto-generated constructor stub
    }

    @Override
    public void mouseWheelMoved(MouseWheelEvent e) {
        System.out.println("scrolled");

    }

}
</code></pre>

<p>When the JFrame opens, there is no event when I roll my mouse wheel. What am I doing wrong?</p>