APL/APL2.1/TP9/Volume/Souris.java

19 lines
353 B
Java
Raw Normal View History

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class Souris implements MouseWheelListener {
Paintvolume draw;
public Souris(Paintvolume draw) {
this.draw = draw;
}
public void mouseWheelMoved(MouseWheelEvent e) {
if (e.getWheelRotation() > 0) {
draw.downVolume();
} else {
draw.upVolume();
}
}
}