Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javafx.application.Application;
- import javafx.event.Event;
- import javafx.event.EventHandler;
- import javafx.geometry.Insets;
- import javafx.scene.Group;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.control.TableColumn;
- import javafx.scene.control.TableView;
- import javafx.scene.control.TextField;
- import javafx.scene.control.cell.PropertyValueFactory;
- import javafx.scene.image.ImageView;
- import javafx.scene.layout.GridPane;
- import javafx.scene.layout.HBox;
- import javafx.scene.layout.VBox;
- import javafx.stage.Stage;
- public class Gconfirmation extends Application implements EventHandler{
- @Override
- public void handle(Event event) {
- final TableView<Objet> livre = new TableView<>();
- final HBox hb = new HBox();
- final HBox a = new HBox();
- final GridPane b = new GridPane();
- 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:";
- final ImageView imageView = new ImageView(imageURI);
- final TextField search = new TextField();
- final Label search1 = new Label("Search");
- final Stage stage = new Stage();
- Data dt = new Data();
- Scene scene = new Scene(new Group());
- stage.setTitle("Librairie - Passer une commande");
- final Label label = new Label("Commande :");
- livre.setItems(dt.getData());
- livre.setEditable(true);
- //Bouton
- final Button recherche = new Button();
- recherche.setText("Recherche");
- hb.getChildren().addAll(recherche);
- final Button Confirmation = new Button();
- Confirmation.setText("Confirmation");
- hb.getChildren().addAll(Confirmation);
- final Button Livraison = new Button();
- Livraison.setText("Livraison");
- hb.getChildren().addAll(Livraison);
- final Button Paiement = new Button();
- Paiement.setText("Paiement");
- hb.getChildren().addAll(Paiement);
- Glivraison c = new Glivraison();
- Confirmation.setOnAction(c);
- //tableau
- TableColumn<Objet, String> firstNameCol = new TableColumn<>("Articles");
- firstNameCol.setCellValueFactory(new PropertyValueFactory<>("nom"));
- TableColumn<Objet, String> lastNameCol = new TableColumn<>("Prix");
- lastNameCol.setCellValueFactory(new PropertyValueFactory<>("prix"));
- TableColumn<Objet, String> Note = new TableColumn<>("Quantité");
- Note.setCellValueFactory(new PropertyValueFactory<>("quantite"));
- livre.getColumns().addAll(firstNameCol, lastNameCol, Note);
- final Button annuler = new Button();
- annuler.setText("Annuler");
- a.getChildren().addAll(annuler);
- final Button Confirmer = new Button();
- Confirmer.setText("Confirmer");
- a.getChildren().addAll(Confirmer);
- Glivraison d = new Glivraison();
- Confirmer.setOnAction(d);
- final VBox vbox = new VBox();
- vbox.setSpacing(5);
- vbox.setPadding(new Insets (10,0,0,10));
- vbox.getChildren().addAll(label,hb,livre,a);
- ((Group) scene.getRoot()).getChildren().addAll(vbox);
- stage.setScene(scene);
- stage.show();
- }
- @Override
- public void start(Stage primaryStage) throws Exception {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement