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

Spinner control on the grid might be rendered by overlapping the neighboring cells.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P4
    • 9
    • 8u45
    • javafx
    • Windows7

    Description

      Spinner control on the grid might be rendered by overlapping the neighboring cells.
      This problem occurs when you add a spinner control to the grid with the expansion and contraction of the width constraints.

      In the next operation, we can confirm that the spinner control overlaps the rendering of neighboring cells.

      Steps to Reproduce:

      1. Start the test program
      2. I want to change the value of the spinner
      3. resizing the window width, to confirm the expansion of the spinner control


      Test code:

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.Spinner;
      import javafx.scene.control.TextArea;
      import javafx.scene.control.TextField;
      import javafx.scene.layout.ColumnConstraints;
      import javafx.scene.layout.GridPane;
      import javafx.stage.Stage;


      public class SpinnerGridPaneTest extends Application{
        @Override
        public void start(Stage stage) throws Exception {
          GridPane grdiPane = new GridPane();
          grdiPane.setGridLinesVisible(true);
          ColumnConstraints column0 = new ColumnConstraints();
          column0.setMinWidth(10);
          column0.setPrefWidth(200);
          ColumnConstraints column1 = new ColumnConstraints();
          column1.setMinWidth(10);
          column1.setPrefWidth(200);
          ColumnConstraints column2 = new ColumnConstraints();
          column2.setMinWidth(10);
          column2.setPrefWidth(200);

             grdiPane.getColumnConstraints().addAll(column0, column1, column2);
             
          Spinner<Integer> spinner = new Spinner<>(0, 100, 0);
          
          spinner.getValueFactory().setValue(1);

          grdiPane.add(new Label("TextArea"), 0, 1);
          grdiPane.add(new TextArea(), 1, 1);

          
          grdiPane.add(new Label("TextField"), 0, 2);
          grdiPane.add(new TextField(), 1, 2);
          
          grdiPane.add(new Label("Spinner"), 0, 3);
          grdiPane.add(spinner, 1, 3);
          
          Scene scene = new Scene(grdiPane, 800, 800);
              stage.setScene(scene);
              stage.show();
        }
        
        public static void main(String[] args) {
              Application.launch(args);
        }
      }

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            nyoshimotjfx Naohiro Yoshimoto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: