Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードを検討してください。
HBox hbox = new HBox(); Button button1 = new Button("A"); Button button2 = new Button("B"); hbox.getChildren().addAll(button1, button2);
現在の 2 つのノードの間にノードを追加したい場合、最初にすべてのノードを削除してから再度追加せずに追加する方法はありますか?
getChildren()を返すのでObservableList、 を使用add(int index, E element)して目的のインデックスに要素を追加できませんか?
getChildren()
ObservableList
add(int index, E element)