DEV TP02
This commit is contained in:
20
DEV/DEV3.1/TP02/Part1/ClickSwapImageEvent.java
Normal file
20
DEV/DEV3.1/TP02/Part1/ClickSwapImageEvent.java
Normal file
@@ -0,0 +1,20 @@
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
public class ClickSwapImageEvent extends MouseAdapter {
|
||||
|
||||
private ImageWindow window;
|
||||
|
||||
public ClickSwapImageEvent(ImageWindow window) {
|
||||
this.window = window;
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent event) {
|
||||
if(event.getX() > this.window.getWidth() / 2) {
|
||||
this.window.nextImage();
|
||||
return;
|
||||
}
|
||||
|
||||
this.window.lastImage();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user