Skip to content

NPE at javafx.scene.text.Text.getSpanBounds(Text.java:292) #15

@miho

Description

@miho

Just tried to use the CodeArea inside a JFXtras-labs 8 window control. Unfortunately I get the following error:

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at javafx.scene.text.Text.getSpanBounds(Text.java:292)
    at javafx.scene.text.Text.impl_computeGeomBounds(Text.java:1146)
    at javafx.scene.Node.updateGeomBounds(Node.java:3526)

JavaFX TextArea and Text nodes do work.

The error does not occur if I prevent layout calls via setManaged(false).

What I do exactly:

CodeArea textArea = new CodeArea();
textArea.replaceText("my code");

Window w = new Window("CodeEditor");
w.setPreferredSize(400,300);

// content pane is a regular stack pane
w.getContentPane().getChildren().add(textArea);

rootPane.getChildren().add(w);

I'm testing on OS X, JDK 8-b129 and the CodeAreaFX from commit b8846ca3e1fba8e4829ee3d015b305b2bf99380c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions