-
Bug
-
Resolution: Unresolved
-
P4
-
jfx11, 8, 9, 10
-
x86_64
-
generic
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
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