Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. package Assignment6;
  2.  
  3. import javafx.application.Application;
  4. import javafx.stage.Stage;
  5. import javafx.scene.Scene;
  6. import javafx.scene.control.Tab;
  7. import javafx.scene.control.TabPane;
  8. import javafx.scene.layout.StackPane;
  9. import java.util.ArrayList;
  10.  
  11. public class Assignment6 extends Application
  12. {
  13. private TabPane tabPane;
  14. private CreatePane createPane;
  15. private SelectPane selectPane;
  16. private ArrayList<Club> clubList;
  17.  
  18. public void start(Stage stage)
  19. {
  20. StackPane root = new StackPane();
  21.  
  22. //clubList to be used in both createPane & selectPane
  23. clubList = new ArrayList<Club>();
  24.  
  25. selectPane = new SelectPane(clubList);
  26. createPane = new CreatePane(clubList, selectPane);
  27.  
  28. tabPane = new TabPane();
  29.  
  30. Tab tab1 = new Tab();
  31. tab1.setText("Club Creation");
  32. tab1.setContent(createPane);
  33.  
  34. Tab tab2 = new Tab();
  35. tab2.setText("Club Selection");
  36. tab2.setContent(selectPane);
  37.  
  38. tabPane.getSelectionModel().select(0);
  39. tabPane.getTabs().addAll(tab1, tab2);
  40.  
  41. root.getChildren().add(tabPane);
  42.  
  43. Scene scene = new Scene(root, 900, 400);
  44. stage.setTitle("Club Selection Apps");
  45. stage.setScene(scene);
  46. stage.show();
  47. }
  48.  
  49. public static void main(String[] args)
  50. {
  51. launch(args);
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement