Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. import javafx.application.Application;
  2. import javafx.event.Event;
  3. import javafx.event.EventHandler;
  4. import javafx.geometry.Insets;
  5. import javafx.scene.Group;
  6. import javafx.scene.Scene;
  7. import javafx.scene.control.Button;
  8. import javafx.scene.control.Label;
  9. import javafx.scene.control.TableColumn;
  10. import javafx.scene.control.TableView;
  11. import javafx.scene.control.TextField;
  12. import javafx.scene.control.cell.PropertyValueFactory;
  13. import javafx.scene.image.ImageView;
  14. import javafx.scene.layout.GridPane;
  15. import javafx.scene.layout.HBox;
  16. import javafx.scene.layout.VBox;
  17. import javafx.stage.Stage;
  18.  
  19. public class Gconfirmation extends Application implements EventHandler{
  20.  
  21. @Override
  22. public void handle(Event event) {
  23.  
  24. final TableView<Objet> livre = new TableView<>();
  25. final HBox hb = new HBox();
  26. final HBox a = new HBox();
  27. final GridPane b = new GridPane();
  28. final String imageURI = "https://www.google.com/search?q=img&client=firefox-b-ab&source=lnms&tbm=isch&sa=X&ved=0ahUKEwj87NzJgNDaAhWDyRQKHW51Bt8Q_AUICigB&biw=960&bih=943#imgrc=RYBz6TYw2D7ZZM:";
  29. final ImageView imageView = new ImageView(imageURI);
  30. final TextField search = new TextField();
  31. final Label search1 = new Label("Search");
  32. final Stage stage = new Stage();
  33. Data dt = new Data();
  34.  
  35. Scene scene = new Scene(new Group());
  36. stage.setTitle("Librairie - Passer une commande");
  37.  
  38. final Label label = new Label("Commande :");
  39.  
  40. livre.setItems(dt.getData());
  41. livre.setEditable(true);
  42.  
  43. //Bouton
  44. final Button recherche = new Button();
  45. recherche.setText("Recherche");
  46. hb.getChildren().addAll(recherche);
  47.  
  48. final Button Confirmation = new Button();
  49. Confirmation.setText("Confirmation");
  50. hb.getChildren().addAll(Confirmation);
  51.  
  52. final Button Livraison = new Button();
  53. Livraison.setText("Livraison");
  54. hb.getChildren().addAll(Livraison);
  55.  
  56. final Button Paiement = new Button();
  57. Paiement.setText("Paiement");
  58. hb.getChildren().addAll(Paiement);
  59.  
  60. Glivraison c = new Glivraison();
  61. Confirmation.setOnAction(c);
  62.  
  63. //tableau
  64. TableColumn<Objet, String> firstNameCol = new TableColumn<>("Articles");
  65. firstNameCol.setCellValueFactory(new PropertyValueFactory<>("nom"));
  66.  
  67. TableColumn<Objet, String> lastNameCol = new TableColumn<>("Prix");
  68. lastNameCol.setCellValueFactory(new PropertyValueFactory<>("prix"));
  69.  
  70. TableColumn<Objet, String> Note = new TableColumn<>("Quantité");
  71. Note.setCellValueFactory(new PropertyValueFactory<>("quantite"));
  72.  
  73. livre.getColumns().addAll(firstNameCol, lastNameCol, Note);
  74.  
  75. final Button annuler = new Button();
  76. annuler.setText("Annuler");
  77. a.getChildren().addAll(annuler);
  78.  
  79. final Button Confirmer = new Button();
  80. Confirmer.setText("Confirmer");
  81. a.getChildren().addAll(Confirmer);
  82.  
  83. Glivraison d = new Glivraison();
  84. Confirmer.setOnAction(d);
  85.  
  86. final VBox vbox = new VBox();
  87. vbox.setSpacing(5);
  88. vbox.setPadding(new Insets (10,0,0,10));
  89. vbox.getChildren().addAll(label,hb,livre,a);
  90.  
  91. ((Group) scene.getRoot()).getChildren().addAll(vbox);
  92.  
  93. stage.setScene(scene);
  94. stage.show();
  95.  
  96. }
  97.  
  98. @Override
  99. public void start(Stage primaryStage) throws Exception {
  100.  
  101. }
  102.  
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement