[英]javafx clickable image Map
how can i implement clickable image map in javafx.when i click on the map i want to print that particular state name. 如何在javafx中实现可点击的图像映射。当我点击地图时我想要打印该特定的州名。 The similar example found here 这里发现了类似的例子
can it is possible in javafx?if yes.then...How? javafx有可能吗?如果是的话。那么......怎么样? i used 我用了
imageView.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent me) {
Point p = MouseInfo.getPointerInfo().getLocation();
mytext.setText(p.toString());
System.out.println(p.toString());
}
});
on image but it not full my purpose. 在图像上,但它没有充分我的目的。
I guess PuzzlePieces demo is a very best and helpful example for what you want to do. 我想PuzzlePieces演示是你想要做的最好和最有用的例子。 Have a look on the provided link. 看看提供的链接。
https://bitbucket.org/shemnon/javafx-gradle/src/4f1f197a845d/Ensemble2/src/main/java/ensemble/samples/graphics/PuzzlePieces.java https://bitbucket.org/shemnon/javafx-gradle/src/4f1f197a845d/Ensemble2/src/main/java/ensemble/samples/graphics/PuzzlePieces.java
Something like that ? 那样的东西?
imageImport.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent mouseEvent) {
System.out.print(mouseEvent.getX());
System.out.print(mouseEvent.getY());
}
});
or you want more than the x and y ? 或者你想要的不仅仅是x和y?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.