I'm coding in JavaFX. I'm creating a border pane with a tab pane with 5 tabs. When the user clicks in one, the system has to load the specific anchor pane. These 5 distinct panes are created in 5 different main.java, so when I run one of them, it wil load one at a time. My question is: How can I load the anchor pane from the main.java and insert it into the tab pane? Thanks! Sorry for my english
Asked
Active
Viewed 170 times
0
-
What do you mean by "5 different main.java"? Do you mean the `AnchorPane`s are defined in five different `Application` subclasses? – James_D May 09 '18 at 12:47
-
Correct, and in these subclasses there is a "public static void main (String[] args)" to run them – MatteoRK22 May 09 '18 at 13:15
-
1You shouldn't really define the UI components directly in the `Application` subclasses. Just move the `AnchorPane`s to regular standalone classes, that you can reuse from either the different `Application` subclasses, or from the `TabPane`. See https://stackoverflow.com/q/32464698 – James_D May 09 '18 at 13:27
-
Ok thanks, I will try! – MatteoRK22 May 09 '18 at 13:35