Example usage for javafx.scene.control Accordion expandedPaneProperty

List of usage examples for javafx.scene.control Accordion expandedPaneProperty

Introduction

In this page you can find the example usage for javafx.scene.control Accordion expandedPaneProperty.

Prototype

public final ObjectProperty<TitledPane> expandedPaneProperty() 

Source Link

Document

The expanded TitledPane in the Accordion.

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group g = new Group();
    Scene scene = new Scene(g, 550, 250);

    TitledPane t1 = new TitledPane("T1", new Button("B1"));
    TitledPane t2 = new TitledPane("T2", new Button("B2"));
    TitledPane t3 = new TitledPane("T3", new Button("B3"));
    Accordion accordion = new Accordion();
    accordion.getPanes().addAll(t1, t2, t3);

    accordion.expandedPaneProperty()
            .addListener((ObservableValue<? extends TitledPane> ov, TitledPane old_val, TitledPane new_val) -> {
                if (new_val != null) {
                    System.out.println(accordion.getExpandedPane().getText());
                }/*  ww  w.j av a  2 s  .  c  om*/
            });

    g.getChildren().add(accordion);

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");

    Group g = new Group();
    Scene scene = new Scene(g, 550, 250, Color.web("0x0000FF", 1.0));

    TitledPane t1 = new TitledPane("T1", new Button("B1"));
    TitledPane t2 = new TitledPane("T2", new Button("B2"));
    TitledPane t3 = new TitledPane("T3", new Button("B3"));
    Accordion accordion = new Accordion();
    accordion.getPanes().addAll(t1, t2, t3);

    ObjectProperty<TitledPane> p = accordion.expandedPaneProperty();

    g.getChildren().add(accordion);//from  w w  w.  j  av a2 s.  c om

    primaryStage.setScene(scene);
    primaryStage.show();
}