forked from bryres/SoccerLeague_JavaFx_Start
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainFrame.java
More file actions
57 lines (43 loc) · 1.46 KB
/
MainFrame.java
File metadata and controls
57 lines (43 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.sql.SQLException;
import coach.CoachView;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import league.LeagueView;
// import team.TeamView;
public class MainFrame extends Application {
public static void main(String[] args) {
launch(args);
}
public void start(Stage primaryStage) throws SQLException {
LeagueView lv = new LeagueView();
CoachView cv = new CoachView();
// TeamView tv = new TeamView();
TabPane tabPane = new TabPane();
Tab tab1 = new Tab("Leagues", lv.getLeagueTab());
Tab tab2 = new Tab("Coaches", cv.getCoachTab());
// Tab tab3 = new Tab("Teams" , tv.getTeamTab());
tabPane.getTabs().add(tab1);
tabPane.getTabs().add(tab2);
// tabPane.getTabs().add(tab3);
tab1.setOnSelectionChanged(ev -> {
lv.reloadLeagues();
});
tab2.setOnSelectionChanged(ev -> {
cv.reloadCoachs();
});
// tab3.setOnSelectionChanged(ev -> {
// tv.reloadTeams();
// });
VBox vBox = new VBox(tabPane);
Scene scene = new Scene(vBox);
primaryStage.setScene(scene);
primaryStage.setTitle("Recreation Soccer League");
primaryStage.setWidth(800);
primaryStage.setHeight(600);
primaryStage.show();
}
}