Advertisement
Guest User

Assignment6

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