Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. package application;
  2.  
  3. import java.io.FileInputStream;
  4. import java.io.FileNotFoundException;
  5. import java.util.ArrayList;
  6. import java.util.Set;
  7. import java.io.File;
  8.  
  9. import javafx.application.Application;
  10. import javafx.collections.FXCollections;
  11. import javafx.collections.ObservableList;
  12. import javafx.event.ActionEvent;
  13. import javafx.event.EventHandler;
  14. import javafx.geometry.Pos;
  15. import javafx.scene.Scene;
  16. import javafx.scene.control.Alert;
  17. import javafx.scene.control.Button;
  18. import javafx.scene.control.ButtonType;
  19. import javafx.scene.control.CheckBox;
  20. import javafx.scene.control.ComboBox;
  21. import javafx.scene.control.PasswordField;
  22. import javafx.scene.control.RadioButton;
  23. import javafx.scene.control.TextField;
  24. import javafx.scene.control.ToggleGroup;
  25. import javafx.scene.image.Image;
  26. import javafx.scene.image.ImageView;
  27. import javafx.scene.input.DragEvent;
  28. import javafx.scene.input.InputEvent;
  29. import javafx.scene.layout.HBox;
  30. import javafx.scene.layout.VBox;
  31. import javafx.scene.text.Font;
  32. import javafx.scene.text.FontWeight;
  33. import javafx.scene.text.Text;
  34.  
  35. import javafx.stage.Stage;
  36.  
  37.  
  38. public class Homework1 extends Application {
  39.  
  40.  
  41. public void start(Stage primaryStage) {
  42. // Headline
  43. Text MasterText = new Text(" Welcome to Sherwin Williams PRO");
  44. MasterText.setFont(Font.font("Roman Black", FontWeight.EXTRA_BOLD,20));
  45. // top right login
  46. TextField T1 = new TextField("");
  47. PasswordField T2 = new PasswordField();
  48. Text username= new Text("Color number:");
  49. Text Password= new Text("Product:");
  50. //drop down for shipping
  51. ObservableList<String> dropdown= FXCollections.observableArrayList("Interior","Exterior"
  52. );
  53. ComboBox<String> cbox= new ComboBox<String> (dropdown);
  54. cbox.setValue("Int or Ext");
  55.  
  56. ObservableList<String> Size= FXCollections.observableArrayList(
  57. "Gallon", "Bucket");
  58. ComboBox<String> Sizes= new ComboBox<String> (Size);
  59. Sizes.setValue("Size");
  60.  
  61.  
  62. Button buy= new Button("Cancel");
  63.  
  64. Alert alert= new Alert(Alert.AlertType.INFORMATION);
  65. alert.setHeaderText("Thank You!");
  66.  
  67. ArrayList<String> un = new ArrayList<> ();
  68. ArrayList<String> pass = new ArrayList<> ();
  69. Button login= new Button("Formulate");
  70.  
  71. ButtonType button = new ButtonType("Pick store location");
  72. ButtonType Button2 = new ButtonType("Order more paint");
  73.  
  74. Alert alert2= new Alert(Alert.AlertType.INFORMATION);
  75. alert.setHeaderText("Thank you for shoppwing with us!");
  76.  
  77.  
  78. alert.getButtonTypes().setAll(button, Button2);
  79. alert2.getContentText();
  80. buy.setOnAction(new EventHandler<ActionEvent>(){
  81. public void handle (ActionEvent event){
  82. alert.show();
  83. }
  84. });
  85.  
  86. login.setOnAction(new EventHandler<ActionEvent>()
  87. {
  88. public void handle (ActionEvent event)
  89. {
  90. T1.setText("");
  91. T2.setText("");
  92. Alert alert2 = new Alert(Alert.AlertType.CONFIRMATION);
  93. alert2.show();
  94. alert2.setHeaderText("Formulated");
  95. un.add(T1.getText());
  96. pass.add(T2.getSelectedText());
  97. }
  98. });
  99.  
  100. Image image = new Image("http://i.imgur.com/4lgcLe2.png");
  101. ImageView ImageView= new ImageView (image);
  102.  
  103.  
  104. HBox masterBox = new HBox(25);
  105. VBox v1 = new VBox(50);
  106. VBox v2 = new VBox(25);
  107. VBox v3 = new VBox (25);
  108. VBox v1_1 = new VBox(25);
  109. VBox v3_1 = new VBox(25);
  110. HBox h1 = new HBox (5);
  111. HBox h2 = new HBox(5);
  112. HBox h3 = new HBox (25);
  113. v1.getChildren().addAll(ImageView);
  114.  
  115. v1.getChildren().addAll(v1_1);
  116. v2.getChildren().addAll(MasterText,cbox,Sizes);
  117. h1.getChildren().addAll(username,T1);
  118. h2.getChildren().addAll(Password,T2,login);
  119. v3.getChildren().addAll(v3_1,buy);
  120. v3_1.getChildren().addAll(h1,h2);
  121.  
  122. masterBox.getChildren().addAll(v1,v2,v3);
  123.  
  124.  
  125.  
  126.  
  127. Scene scene = new Scene(masterBox, 900, 200);
  128.  
  129. primaryStage.setTitle("Homework1"); // Set the stage title
  130. primaryStage.setScene(scene); // Place the scene in the stage
  131. primaryStage.show(); // Display the stage
  132. }
  133.  
  134. public static void main(String[] args) {
  135. launch(args);
  136. }
  137.  
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement