小编tur*_*hay的帖子

拖动后ScrollPane内容变得模糊

JavaFX 8.0有此错误,我不知道如何解决。
示例:http//i.imgur.com/tavh6XA.png

如果拖动ScrollPane,其内容将变得模糊,但是如果将其拖动回,则内容将恢复其清晰度。如果我不修改坐标,则内容看起来会很好。

有人解决了这个问题吗?

示例代码:

@Override
public void start(Stage stage) {
            Pane pane = new Pane();

    Scene scene = new Scene(pane, 500, 500);
    pane.prefWidthProperty().bind(scene.widthProperty());
    pane.prefHeightProperty().bind(scene.heightProperty());

    ScrollPane scroll = new ScrollPane();

    // Center ScrollPane
    scroll.layoutXProperty().bind(pane.widthProperty().divide(2).subtract(scroll.widthProperty().divide(2)));
    scroll.layoutYProperty().bind(pane.heightProperty().divide(2).subtract(scroll.heightProperty().divide(2)));
    scroll.setPrefSize(200, 200);

    ListView<String> list = new ListView<>();
    scroll.setContent(list);

    list.getItems().addAll("Resize the window", "and see how this list", "becomes blurry");

    // Label indicates x, y coords of ScrolPane and their ratio.
    TextField size = new TextField();
    size.setPrefWidth(500);
    size.textProperty().bind(
            scroll.layoutXProperty()
            .asString("x: %s; ").concat(
                    scroll.layoutYProperty() …
Run Code Online (Sandbox Code Playgroud)

java javafx-8

5
推荐指数
3
解决办法
2381
查看次数

标签 统计

java ×1

javafx-8 ×1