grid.add(label,1, 3);
gridTitlePane.setText("Grid");
gridTitlePane.setContent(grid);
// --- Accordion
final Accordion accordion = new Accordion ();
for (int i = 0; i < imageNames.length; i++) {
images[i] = new
Image(AquaFx.class.getResource("demo/images/"+imageNames[i] + ".png").toExternalForm());
pics[i] = new ImageView(images[i]);
tps[i] = new TitledPane(imageNames[i],pics[i]);
}
accordion.getPanes().addAll(tps);
accordion.setExpandedPane(tps[0]);
accordion.expandedPaneProperty().addListener(new
ChangeListener<TitledPane>() {
public void changed(ObservableValue<? extends TitledPane> ov,
TitledPane old_val, TitledPane new_val) {
if (new_val != null) {
label.setText(accordion.getExpandedPane().getText() +
".jpg");
}
}
});