Skip to content
Snippets Groups Projects
Select Git revision
  • cda5d12376fe4e5c7bda2c5fd4bc8d00631f06b8
  • main default protected
  • 1-add-queue_init
  • gawen.ackermann-main-patch-93048
  • gawen.ackermann-main-patch-40987
  • 6-add-queue_is_full
  • gawen.ackermann-main-patch-80315
  • 1-add-queue_init-2
  • 1-add-queue_init-3
  • 5-add-queue_dequeue
  • 6-add-queue_is_full-2
  • 4-add-queue_destroy
  • 7-add-queue_head
  • 7-add-queue_head-2
  • 8-add-queue_tail
15 results

queue.c

Blame
  • HelloController.java 15.66 KiB
    package com.example.tpfx;
    
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.fxml.FXML;
    import javafx.scene.control.*;
    
    import java.io.*;
    import java.util.*;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    
    public class HelloController {
        static ArrayList<Contact> contactArray = new ArrayList<>();
        int selectedID = 0; //Save the id of the selected item in the list view
        boolean imported = false; //Used to know whenever we should enable or disable button save/edit
        ObservableList<String> ctType = FXCollections.observableArrayList("Friend", "Family", "Professional");
        //Fx fields
        @FXML
        private TextField txtFirst;
        @FXML
        private TextField txtSearch;
        @FXML
        private TextField txtLast;
        @FXML
        private TextField txtAdd;
        @FXML
        private TextField txtPhone;
        @FXML
        private TextField txtEmail;
        @FXML
        private TextField txtSocial;
        @FXML
        private TextField txtJob;
        @FXML
        private TextField txtOther;
        @FXML
        private Label lblOther;
        @FXML
        private Button btnAdd;
        @FXML
        private Button btnDelete;
        @FXML
        private Button btnEdit;
        @FXML
        private ListView LstCt;
        @FXML
        private ComboBox cbxType;
    
        //Fx functions
        /**
         * Form start up. Hide and Disable unwanted component
         */
        @FXML
        protected void initialize() {
            cbxType.setValue("Friend");
            cbxType.setItems(ctType);
            lblOther.setVisible(false);
            txtOther.setVisible(false);
            btnEdit.setDisable(true);
            btnDelete.setDisable(true);
            btnAdd.setDisable(true);
        }
        /**
         * Redirect the addition of a contact to the correct methode
         */
        @FXML
        protected void AddCt() {
            //enhanced switch, doesn't need break
            switch (cbxType.getValue().toString()){ //Use the combo box value