问题
I am using adding circle on mouse drag with 5px of radius.It is eaving some gap behind .How to make it smooth.
public void onMouseDragged(MouseEvent event) {
Circle circleForShape = new Circle();
circleForShape.setCenterX(event.getX());
circleForShape.setCenterY(event.getY());
circleForShape.setRadius(5);
circleForShape.setSmooth(true);
circleForShape.smoothProperty();
circleForShape.setFill(c);
group.getChildren().add(circleForShape);
}
Nothing on Mouse Pressed & Mouse released event. Adding image for some clarity .
回答1:
I guess you've imported the "wrong" Label (e.g. from AWT), which doesn't extend javafx.scene.Node
. Make sure it is from the javafx.scene.control
package.
来源:https://stackoverflow.com/questions/60511106/i-have-made-pencil-drawing-on-group-but-it-is-drawing-with-some-gaps-leaving-beh