
import javafx.application.Application; 
import javafx.scene.Scene; 
import javafx.scene.control.Button; 
import javafx.scene.control.TextField; 
import javafx.scene.control.ToolBar; 
import javafx.scene.layout.BorderPane; 
import javafx.scene.layout.HBox; 
import javafx.scene.text.Text; 
import javafx.stage.Stage; 

public class Perfo extends Application { 

	private BorderPane pane; 

	@Override 
	public void start(Stage primaryStage) throws Exception { 
		String dialogStyleSheet = getClass().getResource("perfo.css").toExternalForm(); 
		pane = new BorderPane(); 
		final Button button = new Button("click"); 
		TextField textField = new TextField("10"); 
		pane.setTop(new ToolBar(button, textField)); 
		button.setOnAction(e -> { 
			HBox hbox = new HBox(); 
			hbox.getStyleClass().add("myhbox"); 
			int nb = Integer.parseInt(textField.getText()); 
			for (int i = 0; i < nb; i++) { 

				hbox = new HBox(new Text("y"), hbox); 
				hbox.getStyleClass().add("myhbox"); 
			} 
			pane.setCenter(hbox); 

		}); 

		Scene scene = new Scene(pane); 
		scene.getStylesheets().add(dialogStyleSheet); 
		primaryStage.setScene(scene); 
		primaryStage.sizeToScene(); 
		primaryStage.show(); 
	} 

	public static void main(String[] args) { 
		launch(args); 
	} 
} 
