Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8182977

NullPointerException with HTMLEditor when changing the scene graph

XMLWordPrintable

    • web
    • generic
    • generic

        FULL PRODUCT VERSION :
        java version "1.8.0_131"
        Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
        Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        ver 1703

        A DESCRIPTION OF THE PROBLEM :
        When I change the scene graph and the new root contains a HTMLEditor, then a NullPointerException is thrown.

        See the source code of the class "HTMLEditorBug".

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        compile and run the class "HTMLEditorBug"

        ACTUAL -
        NullPointerException

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
        at com.sun.javafx.scene.web.skin.HTMLEditorSkin.updateToolbarState(HTMLEditorSkin.java:964)
        at com.sun.javafx.scene.web.skin.HTMLEditorSkin.lambda$populateToolbars$13(HTMLEditorSkin.java:580)
        at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:361)
        at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
        at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:105)
        at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
        at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
        at javafx.scene.control.ComboBoxBase.setValue(ComboBoxBase.java:150)
        at com.sun.javafx.scene.web.skin.HTMLEditorSkin.lambda$populateToolbars$12(HTMLEditorSkin.java:549)
        at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
        at java.lang.Thread.run(Unknown Source)

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        package javaBugs;

        import javafx.application.Application;
        import javafx.geometry.Insets;
        import javafx.scene.Scene;
        import javafx.scene.control.Label;
        import javafx.scene.layout.StackPane;
        import javafx.scene.web.HTMLEditor;
        import javafx.stage.Stage;

        public class HTMLEditorBug extends Application{

        public static void main(String[] args){
        launch(args);
        }

        @Override
        public void start(Stage primaryStage) throws Exception {
        Label label = new Label("Pane 1");
        StackPane pane1 = new StackPane(label);
        pane1.setPadding(new Insets(10));

        Scene scene = new Scene(pane1, 600, 400);
        primaryStage.setScene(scene);
        primaryStage.show();

        HTMLEditor editor = new HTMLEditor();
        StackPane pane2 = new StackPane(editor);
        pane2.setPadding(new Insets(10));

        scene.setRoot(pane2);
        }
        }
        ---------- END SOURCE ----------

              mbilla Murali Billa
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: