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);
}
}
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);
}
}