private void buttonSubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSubmitActionPerformed
        
        // flag to add item
        boolean added = false;
        
        try {
            if (filedNumber.getText().isEmpty() && filedManufacture.getText().isEmpty() && filedModel.getText().isEmpty() && filedYear.getText().isEmpty() && filedProprietor.getText().isEmpty())
            {
                throw new NullPointerException();
            }
            
            Integer.parseInt(filedYear.getText());
            Manager.add(filedNumber.getText(),filedType.getSelectedItem().toString(),filedManufacture.getText(),filedModel.getText(),filedYear.getText(),filedProprietor.getText());
            added = true;
        } catch (NullPointerException exeption)
        {
            JOptionPane.showMessageDialog(this, "Въведете коректни данни!");
        } catch (NumberFormatException ex)
        {
            JOptionPane.showMessageDialog(this, "Въведете коректни данни за година!");  
        }
        
        
        if ( added)
        {
            // close windows
            this.setVisible(false);
            
            JOptionPane.showMessageDialog(this, "Превозното средство е добавено успешно.");
        }
    }//GEN-LAST:event_buttonSubmitActionPerformed