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

NPE on Label.setMnemonicParsing(false)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      Win 7, b61

      Description

      java.lang.NullPointerException
              at com.sun.javafx.scene.control.skin.LabeledSkinBase.updateDisplayedText(LabeledSkinBase.java:384)
              at com.sun.javafx.scene.control.skin.LabeledSkinBase.layoutLabelInArea(LabeledSkinBase.java:941)
              at com.sun.javafx.scene.control.skin.LabeledSkinBase.layoutLabelInArea(LabeledSkinBase.java:866)
              at com.sun.javafx.scene.control.skin.LabeledSkinBase.layoutChildren(LabeledSkinBase.java:850)
              at javafx.scene.control.Control.layoutChildren(Control.java:481)
              at javafx.scene.Parent.layout(Parent.java:1012)
              at javafx.scene.Parent.layout(Parent.java:1020)
              at javafx.scene.Scene.layoutDirtyRoots(Scene.java:517)
              at javafx.scene.Scene.doLayoutPass(Scene.java:488)
              at javafx.scene.Scene.access$3900(Scene.java:172)
              at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2222)
              at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:346)
              at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:502)
              at com.sun.javafx.tk.quantum.QuantumToolkit$11.run(QuantumToolkit.java:355)
              at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
              at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
              at com.sun.glass.ui.win.WinApplication$3$1.run(Unknown Source)
              at java.lang.Thread.run(Thread.java:662)


      Sample to reproduce:

      import javafx.application.Application;
      import javafx.beans.value.ChangeListener;
      import javafx.beans.value.ObservableValue;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.CheckBox;
      import javafx.scene.control.Label;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;


      public class Main extends Application {

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

          VBox root = new VBox();

          @Override
          public void start(final Stage stage) throws Exception {
              Scene scene = new Scene(root, 300, 300);
              final Label label = new Label("_Label");
              Button button = new Button("Button");
              CheckBox check = new CheckBox("Parse mnemonics");
              check.selectedProperty().addListener(new ChangeListener<Boolean>() {
                  public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
                      label.setMnemonicParsing(t1);
                  }
              });
              root.getChildren().addAll(label, button, check);
              stage.setScene(scene);
              stage.show();
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                miflemi Mick Fleming (Inactive)
                Reporter:
                ogb Oleg Barbashov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:
                  Imported: