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

Pagination disappears when setting new one on scene

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3
    • None
    • jfx11, jfx20, jfx17, jfx21
    • javafx
    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      Pagination disappears when setting new one on scene

      Run the attached class to see that when the 'disappear' flag is true
      and the pagination is not wrapped in a HBox it will disappear.
      This does not happen when it is wrapped in a HBox.

      In general I think the pagination control is pretty buggy. There are
      several open bugs for it here.
      I personally run into this one and #8089578 when writing simple tests for it in our application.

      This bug could be related to #8088490


      CUSTOMER SUBMITTED WORKAROUND :
      import javafx.application.Application;
      import javafx.scene.Parent;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.Pagination;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class PaginationDisappear extends Application
      {

        private boolean disappear = false;

        @Override
        public void start(Stage stage) throws Exception
        {
          Pagination pagination = new Pagination(15);
          pagination.setMaxPageIndicatorCount(5);
          Label label = new Label();
          pagination.setPageFactory(index -> {
            label.setText("" + (index + 1));
            try
            {
              if(index != 0)
                start(stage);
            }
            catch (Exception e)
            {
              e.printStackTrace();
            }
            return label;
          });
          Parent parent = pagination;
          if(!disappear)
            parent = new HBox(pagination);
          stage.setScene(new Scene(parent));
          stage.show();
        }
        
        public static void main(String[] args)
        {
          Application.launch(PaginationDisappear.class);
        }

      }


      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              angorya Andy Goryachev
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: