I'm working on this example of simple panel.
public class MainApp extends Application {
private static BorderPane bp;
@Override
public void start(Stage stage) throws Exception {
FlowPane flow = new FlowPane();
flow.setPadding(new Insets(50, 5, 5, 5));
flow.setVgap(15);
flow.setHgap(15);
flow.setAlignment(Pos.CENTER);
HBox thb = new HBox();
thb.setPadding(new Insets(13, 13, 13, 13));
thb.setStyle("-fx-background-color: gray");
DropShadow ds = new DropShadow();
ds.setOffsetY(3.0);
ds.setOffsetX(3.0);
ds.setColor(Color.GRAY);
bp = new BorderPane();
bp.setEffect(ds);
bp.setPrefSize(600, 500);
bp.setMaxSize(600, 500);
bp.setStyle("-fx-background-color: white;");
bp.setTop(thb);
flow.getChildren().add(bp);
Scene scene = new Scene(flow, 1200, 800);
scene.getStylesheets().add("/styles/Styles.css");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Can you help me to create button which minimizes the panel. I want when I click the button to shrink the size of the panel.
I don't understand basically what you trying to do. I think this might help you.