private void createOrderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createOrderButtonActionPerformed

        Date startDate = null;
        Date endDate = null;
        if (startDateTextField.getText().length()  == 10  &&
            startDateTextField.getText().charAt(2) == '-' &&
            startDateTextField.getText().charAt(5) == '-' &&
            endDateTextField.getText().length()  == 10  &&
            endDateTextField.getText().charAt(2) == '-' &&
            endDateTextField.getText().charAt(5) == '-')
        {
            startDate = control.formatStringToDate(startDateTextField.getText());
            endDate = control.formatStringToDate(endDateTextField.getText());

            try{

                int correct = JOptionPane.showConfirmDialog(rootPane, "Er disse informationer korrekte? \n"
                    + "Ordre ID:                       " + orderIdTextField.getText()
                    + "\nKunde ID:                       " + customerIdTextField.getText()
                    + "\nSalgsmedarbejder ID: "+ salesIdTextField.getText()
                    + "\nStart dato:                      "+ startDateTextField.getText()
                    + "\nSlut dato:                        " + endDateTextField.getText()
                    + "\nPris:                                " + priceTextField.getText());

                if (correct == 0) {
                    currentOrder = new Order(Integer.parseInt(orderIdTextField.getText()),
                        Integer.parseInt(customerIdTextField.getText()),
                        Integer.parseInt(salesIdTextField.getText()),
                        false, startDate, endDate,
                        Integer.parseInt(priceTextField.getText()));
                    System.out.println("Order has been created! (remember to save it) mwehehe"
                        +"\n"+currentOrder);

                    orderIdLabel.setText(currentOrder.getOrderID()+"");
                }
                else{
                    System.out.println("Ordren blev IKKE oprettet!");
                }
            }
            catch(Exception e){
                System.out.println("Ordren blev IKKE oprettet!");
            }

        }
        else{
            JOptionPane.showMessageDialog(rootPane, "Dato formatet skal skrives således: DD-MM-YYYY");
        }

        clearOrderTabTextFields();
    }//GEN-LAST:event_createOrderButtonActionPerformed