I just simply want to change my tabs I created with TabPane from JavaFx with code. I want a Button who switch the Tab when I press. I search for a Function like:tabpane.selectTab(index)
Have anyone a solution?
Asked
Active
Viewed 216 times
-1

Majotube
- 3
- 1
1 Answers
0
You need to get the selection model first
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TabPane.html#getSelectionModel--
And then you can select a tab.
There are other ways to select than by index, read the docs in 2nd link.
tabPane.getSelectionModel().select(index);
note, most or all selections in javaFX seem to use a selectionModel.

brian
- 10,619
- 4
- 21
- 79
-
Thank you very much :D – Majotube Jun 29 '20 at 23:21