24 lines
646 B
Java
24 lines
646 B
Java
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) {
|
|
System.out.println(this.window.manager.cursor);
|
|
if(event.getX() > this.window.getWidth() / 2) {
|
|
this.window.nextImage();
|
|
System.out.println(this.window.manager.cursor);
|
|
return;
|
|
}
|
|
|
|
this.window.previousImage();
|
|
System.out.println(this.window.manager.cursor);
|
|
}
|
|
}
|