Files
BUT2/DEV/DEV3.1/TP02/Part1/ClickSwapImageEvent.java

24 lines
646 B
Java
Raw Normal View History

2025-09-26 08:56:23 +02:00
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) {
2025-10-02 10:48:05 +02:00
System.out.println(this.window.manager.cursor);
2025-09-26 08:56:23 +02:00
if(event.getX() > this.window.getWidth() / 2) {
this.window.nextImage();
2025-10-02 10:48:05 +02:00
System.out.println(this.window.manager.cursor);
2025-09-26 08:56:23 +02:00
return;
}
2025-10-02 10:48:05 +02:00
this.window.previousImage();
System.out.println(this.window.manager.cursor);
2025-09-26 08:56:23 +02:00
}
}