i have made pencil drawing on group but it is drawing with some gaps leaving behind.how to make it smooth? [closed]

谁都会走 提交于 2020-04-12 08:00:54

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!