Controle machine
This commit is contained in:
21
DEV2.1/CM1/04_Illumination/GestionMolette.java
Normal file
21
DEV2.1/CM1/04_Illumination/GestionMolette.java
Normal file
@@ -0,0 +1,21 @@
|
||||
import java.awt.event.*;
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
|
||||
public class GestionMolette implements MouseWheelListener {
|
||||
|
||||
private JPanel fond;
|
||||
|
||||
public GestionMolette(JPanel fond) {
|
||||
this.fond = fond;
|
||||
}
|
||||
|
||||
public void mouseWheelMoved(MouseWheelEvent evenement) {
|
||||
if (evenement.getWheelRotation() < 0) {
|
||||
this.fond.setBackground(Color.WHITE);
|
||||
}
|
||||
else {
|
||||
this.fond.setBackground(Color.BLACK);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user