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

GridPane with rowspan error of height calculating.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8, 9, 10, openjfx11
    • Fix Version/s: tbd
    • Component/s: javafx
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      jdk10.0.1, Debian Linux 8 and Windows 7


      A DESCRIPTION OF THE PROBLEM :
      GridPane does not show nodes properly if rowspan is used.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Launch compiled code.
      Uncomment 01, 02, 03 they'll give another results.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      GridPane with valid view.

      ACTUAL -
      GridPane with invalid view.
      And one more thing: rows of the first sample have different heights.

      ---------- BEGIN SOURCE ----------
      package testfx;

      import javafx.application.Application;
      import javafx.scene.Node;
      import javafx.scene.Scene;
      import javafx.scene.layout.GridPane;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.VBox;
      import javafx.scene.text.Text;
      import javafx.stage.Stage;

      public class Main extends Application {
          public static void main(String[] args) {
              launch( args );
          }
          
          private static Node prNode() {
              VBox ret;
              final GridPane gp = new GridPane();
              gp.setGridLinesVisible( true );
              
              /*
              // 01
              gp.add( new Text( "aaa\nbbb\nccc\nddd\neee" ), 0, 0, 1, 2 );
              gp.add( new Text( "aaaa1" ), 1, 0, 1, 1 );
              gp.add( new Text( "aaaa2" ), 1, 1, 1, 1 );
              */
              
              /*
              // 02
              gp.add( new Text( "aaa\nbbb\nccc\nddd\neee" ), 0, 0, 1, 2 );
              gp.add( new Text( "aaaa1" ), 1, 0, 1, 1 );
              gp.add( new Text( "aaaa2" ), 1, 1, 1, 2 ); // '1' -> '2'
              */
              
              // 03
              // if we set rowspan=4 or 2 we'll get another result
              /*gp.add( new Text( "aaa\nbbb\nccc\nddd\neee" ), 0, 0, 1, 3 );
              gp.add( new Text( "aaaa1" ), 1, 0, 1, 1 );
              gp.add( new Text( "aaaa2" ), 1, 1, 1, 2 );
              */
              
              /*
              // 04
              gp.add( new Text( "aaa\nbbb\nccc\nddd\neee" ), 0, 0, 1, 3 );
              gp.add( new Text( "aaaa1" ), 1, 0, 1, 1 );
              gp.add( new Text( "aaaa2" ), 1, 1, 1, 2 );
              gp.add( new Text( "xxx11" ), 2, 0, 1, 1 );
              gp.add( new Text( "xxx21" ), 2, 1, 1, 1 );
              gp.add( new Text( "xxx22" ), 2, 2, 1, 1 );
              */
              
              ret = new VBox( 8, new Text( "text1" ), gp, new Text( "text2" ) );
              
              return ret;
          }
          
          @Override
          public void start(Stage stage) {
              final StackPane root = new StackPane();
              root.getChildren().add( prNode() );
              
              final Scene scene = new Scene( root, 300, 250 );
              
              stage.setTitle( "Hello World!" );
              stage.setScene( scene );
              stage.show();
          }
      }

      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: