AWT
MouseWheelListener listener = new MouseWheelListener() {
public void mouseWheelMoved(MouseWheelEvent e) {
int count = e.getWheelRotation();
int direction = (Math.abs(count) > 0) ? UP : DOWN;
changeBackground(frame, direction);
}
};
button.addMouseWheelListener(listener);