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

[Accordion] Width adjustment to the size of content has changed.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      jdk 1.8.0-ea-b59

      Description

      When the width of content is larger than the width of accordion it is not adjusted to the content's width.

      /*
       * To change this template, choose Tools | Templates
       * and open the template in the editor.
       */
      package test.example;

      import javafx.application.Application;
      import javafx.geometry.Pos;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.TitledPane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;
      import javafx.scene.control.Accordion;

      /**
       *
       * @author dm_zinkevich
       */
      public class AccordionApp extends Application {

          private static int SLOT_WIDTH = 350;
          private static int SLOT_HEIGHT = 250;

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              Accordion accordion = new Accordion();
              for (int i = 0; i < 5; i++) {
                  Label label = new Label("Pane " + i + " Content");
                  label.setPrefSize(SLOT_WIDTH * 1.2, SLOT_HEIGHT * 1.2);
                  label.setMinSize(SLOT_WIDTH * 1.2, SLOT_HEIGHT * 1.2);
                  label.setMaxSize(SLOT_WIDTH * 1.2, SLOT_HEIGHT * 1.2);
                  TitledPane titled_pane = new TitledPane("Pane " + i, label);
                  accordion.getPanes().add(titled_pane);
              }
              accordion.setMaxSize(SLOT_WIDTH, SLOT_HEIGHT);
              accordion.setPrefSize(SLOT_WIDTH, SLOT_HEIGHT);

              Label label = new Label("stage.setTitle(System.getProperty(\"java.runtime.version\") + \"; \" + System.getProperty(\"javafx.runtime.version\"));");
              label.setPrefSize(SLOT_WIDTH * 1.2, SLOT_HEIGHT * 1.2);
              label.setMinSize(SLOT_WIDTH * 1.2, SLOT_HEIGHT * 1.2);
              label.setMaxSize(SLOT_WIDTH * 1.2, SLOT_HEIGHT * 1.2);

              VBox root = new VBox(5d);
              root.getChildren().addAll(accordion, label);

              Scene scene = new Scene(root);
              stage.setScene(scene);
              stage.setTitle(System.getProperty("java.runtime.version") + "; " + System.getProperty("javafx.runtime.version"));
              stage.show();
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              raginip Ragini Prasad (Inactive)
              Reporter:
              dzinkevi Dmitry Zinkevich (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:
                Imported: