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

SplitPane with a TextField control on the left and moving divider left throws a IllegalArgumentException Both width and height must be >= 0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P4
    • 8u20
    • fx2.0
    • javafx
    • JavaFX 2.0 build 42, Java 7.0, Windows 7

    Description

      When creating a split pane with one TextField control on the left. When the user moves divider to the left an exception is thrown the divider becomes locked or (won't move).

      To reproduce:
      1) keep the textfield blank
      2) move divider as far left as you can.
      3) observe the errors.


      Attached is a simple test to reproduce the problem.

      Here is a code snippet:

         @Override
          public void start(Stage primaryStage) {
              Group root = new Group();
              Scene scene = new Scene(root, 380, 118, Color.WHITE);

              // Left and right split pane
              SplitPane splitPane = new SplitPane();
              splitPane.prefWidthProperty().bind(scene.widthProperty());
              splitPane.prefHeightProperty().bind(scene.heightProperty());
              
              VBox leftArea = new VBox(10);
              leftArea.getChildren().add(new TextField());
              
              VBox rightArea = new VBox(10);
              splitPane.getItems().addAll(leftArea, rightArea);
              
              HBox hbox = new HBox();
              hbox.getChildren().add(splitPane);
              root.getChildren().add(hbox);
              
              primaryStage.setScene(scene);
              
              primaryStage.show();
          }



      java.lang.IllegalArgumentException: Both width and height must be >= 0
      at javafx.geometry.Rectangle2D.<init>(Rectangle2D.java:106)
      at com.sun.javafx.scene.control.skin.TextFieldSkin.getCharacterBounds(TextFieldSkin.java:412)
      at com.sun.javafx.scene.control.skin.TextFieldSkin.scrollCharacterToVisible(TextFieldSkin.java:418)
      at com.sun.javafx.scene.control.skin.TextFieldSkin.layoutChildren(TextFieldSkin.java:319)
      at javafx.scene.Parent.layout(Parent.java:886)
      at javafx.scene.Parent.layout(Parent.java:896)
      at javafx.scene.Parent.layout(Parent.java:896)
      at javafx.scene.Parent.layout(Parent.java:896)
      at javafx.scene.Parent.layout(Parent.java:896)
      at javafx.scene.Scene.layoutDirtyRoots(Scene.java:428)
      at javafx.scene.Scene.doLayoutPass(Scene.java:401)
      at javafx.scene.Scene.access$2800(Scene.java:126)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:1719)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:283)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:398)
      at com.sun.javafx.tk.quantum.QuantumToolkit$10.run(QuantumToolkit.java:330)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
      at java.lang.Thread.run(Thread.java:722)

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            cdea Carl Dea
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: