0
我想將滾動條添加到此代碼中。怎麼可能 - 如果可能的話解釋一下。我試過但沒有成功。取而代之的在javafx中添加滾動條
border.setLeft(gridPane);
public void start(Stage primaryStage) {
BorderPane border=new BorderPane();
GridPane gridpane=new GridPane();
HBox hbox=new HBox();
Button btn=new Button("btn");
hbox.getChildren().add(btn);
btn.setOnAction(new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent e)
{
Label text=new Label("hello");
gridpane.add(text, 0, b);
b++;
}
}
);
border.setTop(hbox);
border.setLeft(gridpane);
Scene scene=new Scene(border,460,250);
primaryStage.setScene(scene);
primaryStage.show();
}