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

[Layout] Stage must be resized to force layout

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:

      Description

      1) run TestAlignment
      2) BUG: the window comes up empty
      3) resize the window and it will draw / layout


      /*
       * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
       * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       */


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

      /**
       *
       * @author Pavel Kouznetsov (pavel.kouznetsov@oracle.com)
       */
      public class TestAlignment extends Application{

          @Override
          public void start(Stage stage) throws Exception {
              int panes_num = 5;

              Accordion accordion = new Accordion();
              for (int i = 0; i < panes_num; i++) {
                  Label label = new Label("Pane " + i + " Conten1t");
                  label.setAlignment(Pos.TOP_LEFT);

                  TitledPane pane = new TitledPane("Pane " + i, label);
                  System.out.println(i + " : align = " + pane.getAlignment().name());
                  accordion.getPanes().add(pane);
              }
              accordion.setExpandedPane(accordion.getPanes().get(3));
              System.out.println("expanded align = " + accordion.getPanes().get(3).getAlignment().name());

              stage.setScene(new Scene(accordion, 400, 400));
              stage.show();
          }

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

      }

        Attachments

          Activity

            People

            Assignee:
            msladecek Martin Sládeček
            Reporter:
            snorthov Steve Northover (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: