I'm trying to double click at an item on a ListView and then something should happen. While i found a few solutions here and also found a post with this exact error, I'm not really able to solve it myself.
My example code:
public class MainTest {
public static void main(String[] args) {
new test();
}
}
public class Test extends AnchorPane implements EventHandler<ActionEvent>{
private ListView<String> list = new ListView<String>();
public Test() {
super();
list.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
}
});
}
}
I need the EventHandler<ActionEvent>
for a button.
Full error:
Type argument MousEvent is not within bounds of type-variable T where T is a type-variable: T extends Event declared in interface EventHandler incompatible types: <anonymous EventHandler<java.awt.event.MouseEvent>> cannot be converted to EventHandler<? super javafx.scene.input.MouseEvent>