common.SwingGUI01.java Source code

Java tutorial

Introduction

Here is the source code for common.SwingGUI01.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package common;

import agency.Agency;
import agency.AgencyManager;
import agency.AgencyManagerImpl;
import agency.Agent;
import agency.AgentManager;
import agency.AgentManagerImpl;
import agency.Mission;
import agency.MissionManager;
import agency.MissionManagerImpl;
import java.awt.Color;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sql.DataSource;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import org.apache.commons.dbcp2.BasicDataSource;

/**
 *
 * @author martin
 */
public class SwingGUI01 extends javax.swing.JFrame {

    private DataSource dataSource;
    private AgentManager agentManager;
    private MissionManager missionManager;
    private AgencyManager agencyManager;

    private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(SwingGUI01.class);
    private String errorMessage;

    /**
     * Creates new form SwingGUI01
     */
    public SwingGUI01() {

        //init DB
        dataSource = prepareDataSource();

        try {
            DBUtils.executeSqlScript(dataSource, Agency.class.getResource("/agencyDB.sql"));
        } catch (SQLException ex) {
            Logger.getLogger(SwingGUI01.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            errorMessage = "Error opening script files";
            log.error(errorMessage, ex);
            showErrorDialog(errorMessage);
        }

        agentManager = new AgentManagerImpl(dataSource);
        missionManager = new MissionManagerImpl(dataSource);
        agencyManager = new AgencyManagerImpl(dataSource);

        initComponents();
        getContentPane().setBackground(Color.GRAY);

        //title renaming
        setTitle(ResourceBundle.getBundle("strings").getString("agency"));

        //tabs renaming
        jTabbedPane2.setTitleAt(0, ResourceBundle.getBundle("strings").getString("agentsTable"));
        jTabbedPane2.setTitleAt(1, ResourceBundle.getBundle("strings").getString("missionTable"));

        //agents table inicialization
        AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();
        agentsTable.getColumnModel().getColumn(0).setPreferredWidth(200);
        agentsTable.getColumnModel().getColumn(1).setPreferredWidth(100);
        agentsTable.getColumnModel().getColumn(2).setPreferredWidth(43);
        agentsTable.getColumnModel().getColumn(3).setPreferredWidth(400);
        agentsTable.getColumnModel().getColumn(4).setPreferredWidth(200);

        //missions table inicialization
        MissionsTableModel missionsModel = (MissionsTableModel) missionsTable.getModel();
        missionsTable.getColumnModel().getColumn(0).setPreferredWidth(200);
        missionsTable.getColumnModel().getColumn(1).setPreferredWidth(100);
        missionsTable.getColumnModel().getColumn(2).setPreferredWidth(100);
        missionsTable.getColumnModel().getColumn(3).setPreferredWidth(100);
        missionsTable.getColumnModel().getColumn(4).setPreferredWidth(100);
        missionsTable.getColumnModel().getColumn(5).setPreferredWidth(625 - 300);

        //disable column reorganization
        agentsTable.getTableHeader().setReorderingAllowed(false);
        missionsTable.getTableHeader().setReorderingAllowed(false);

        //add all agents via SwingWorker
        agentSwingWorker = new AgentSwingWorker(null, TableOperations.ADD_ALL);
        agentSwingWorker.execute();

        missionSwingWorker = new MissionSwingWorker(null, TableOperations.ADD_ALL);
        missionSwingWorker.execute();

    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        addAgentDialog = new javax.swing.JDialog();
        jLabel2 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        addAgentDialogName = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        addAgentDialogNote = new javax.swing.JTextArea();
        agentDialogAddAgentButton = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        addAgentDialogLevel = new javax.swing.JComboBox();
        addAgentDialogBorn = new com.toedter.calendar.JDateChooser();
        editAgentDialog = new javax.swing.JDialog();
        jLabel6 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        editAgentDialogName = new javax.swing.JTextField();
        editAgentDialogEditAgentButton = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        editAgentDialogNote = new javax.swing.JTextArea();
        jButton7 = new javax.swing.JButton();
        editAgentDialogLevel = new javax.swing.JComboBox();
        editAgentDialogBorn = new com.toedter.calendar.JDateChooser();
        deleteAgentDialog = new javax.swing.JDialog();
        jLabel11 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        deleteAgentDialogSureCheck = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        deleteAgentDialogDeleteButton = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        findAgentDialog = new javax.swing.JDialog();
        jLabel14 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        findAgentDialogComboBox = new javax.swing.JComboBox();
        findAgentDialogFindAgentbutton = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        addMissionDialog = new javax.swing.JDialog();
        jPanel8 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        addMissionDialogNote = new javax.swing.JTextArea();
        add = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        addMissionDialogCapacity = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        addMissionDialogName = new javax.swing.JTextField();
        addMissionDialogDifficulty = new javax.swing.JComboBox();
        addMissionDialogBeginDate = new com.toedter.calendar.JDateChooser();
        addMissionDialogEndDate = new com.toedter.calendar.JDateChooser();
        jLabel20 = new javax.swing.JLabel();
        editMissionDialog = new javax.swing.JDialog();
        jLabel22 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        editMissionDialogNote = new javax.swing.JTextArea();
        add1 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jLabel27 = new javax.swing.JLabel();
        editMissionDialogCapacity = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        editMissionDialogName = new javax.swing.JTextField();
        editMissionDialogDifficulty = new javax.swing.JComboBox();
        editMissionDialogBeginDate = new com.toedter.calendar.JDateChooser();
        editMissionDialogEndDate = new com.toedter.calendar.JDateChooser();
        deleteMissionDialog = new javax.swing.JDialog();
        jPanel10 = new javax.swing.JPanel();
        deleteMissionDialogSureCheck = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jButton9 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jLabel30 = new javax.swing.JLabel();
        findMissionDialog = new javax.swing.JDialog();
        jLabel31 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jLabel32 = new javax.swing.JLabel();
        findMissionDialogComboBox = new javax.swing.JComboBox();
        jButton13 = new javax.swing.JButton();
        jButton14 = new javax.swing.JButton();
        assignDialog = new javax.swing.JDialog();
        jLabel46 = new javax.swing.JLabel();
        jPanel17 = new javax.swing.JPanel();
        jLabel47 = new javax.swing.JLabel();
        assignDialogMissionsComboBox = new javax.swing.JComboBox();
        assignAgentToMissionAssignButton = new javax.swing.JButton();
        jButton26 = new javax.swing.JButton();
        jLabel48 = new javax.swing.JLabel();
        assignDialogAgentsComboBox = new javax.swing.JComboBox();
        withdrawDialog = new javax.swing.JDialog();
        jPanel13 = new javax.swing.JPanel();
        jLabel37 = new javax.swing.JLabel();
        withdrawAgentFromMissionAgentComboBox = new javax.swing.JComboBox();
        withdrawDialogWithdrawButton = new javax.swing.JButton();
        jButton18 = new javax.swing.JButton();
        jLabel45 = new javax.swing.JLabel();
        withdrawAgentFromMissionMissionComboBox = new javax.swing.JComboBox();
        jLabel38 = new javax.swing.JLabel();
        agentsOnMissionDialog = new javax.swing.JDialog();
        jPanel14 = new javax.swing.JPanel();
        jLabel39 = new javax.swing.JLabel();
        findAgentsOnMissionComboBox = new javax.swing.JComboBox();
        findAgentsFindButton = new javax.swing.JButton();
        jButton20 = new javax.swing.JButton();
        jLabel40 = new javax.swing.JLabel();
        missionWithAgentDialog = new javax.swing.JDialog();
        jPanel15 = new javax.swing.JPanel();
        jLabel41 = new javax.swing.JLabel();
        findMissionWithAgentComboBox = new javax.swing.JComboBox();
        jButton21 = new javax.swing.JButton();
        jButton22 = new javax.swing.JButton();
        jLabel42 = new javax.swing.JLabel();
        availableAgentsDialog = new javax.swing.JDialog();
        jPanel16 = new javax.swing.JPanel();
        jLabel43 = new javax.swing.JLabel();
        findAvailableAgentsComboBox = new javax.swing.JComboBox();
        findAvailableAgentsFindButton = new javax.swing.JButton();
        jButton24 = new javax.swing.JButton();
        jLabel44 = new javax.swing.JLabel();
        agentListTable = new javax.swing.JDialog();
        scrollpane = new javax.swing.JScrollPane();
        agentListAgentTable = new javax.swing.JTable();
        findAgentsLabel = new javax.swing.JLabel();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        addAgentButton = new javax.swing.JButton();
        editAgentButton = new javax.swing.JButton();
        deleteAgentButton = new javax.swing.JButton();
        findAgentButton = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        agentsTable = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        missionsTable = new javax.swing.JTable();
        addMissionButton = new javax.swing.JButton();
        editMissionButton = new javax.swing.JButton();
        deleteMissionButton = new javax.swing.JButton();
        findMissionButton = new javax.swing.JButton();
        Title = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        assignAgentToMissionButton = new javax.swing.JButton();
        findAgentsOnMissionButton = new javax.swing.JButton();
        findMissionWithAgentButton = new javax.swing.JButton();
        findAvailableAgentsButton = new javax.swing.JButton();
        withdrawAgentFromMissionButton = new javax.swing.JButton();
        findAvailableAgentsForMissionButton = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        exitMenuItem = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("strings"); // NOI18N
        addAgentDialog.setTitle(bundle.getString("addAgent")); // NOI18N
        addAgentDialog.setAlwaysOnTop(true);
        addAgentDialog.setBackground(new java.awt.Color(0, 204, 204));
        addAgentDialog.setMinimumSize(new java.awt.Dimension(320, 350));
        addAgentDialog.setName("addDialog"); // NOI18N

        jLabel2.setBackground(new java.awt.Color(0, 100, 200));
        jLabel2.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 150, 0));
        jLabel2.setText(bundle.getString("addAgent")); // NOI18N
        jLabel2.setOpaque(true);

        jPanel4.setPreferredSize(new java.awt.Dimension(461, 300));

        addAgentDialogName.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        addAgentDialogName.setMinimumSize(new java.awt.Dimension(192, 30));

        jLabel1.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel1.setText(bundle.getString("nameColumn")); // NOI18N

        jLabel3.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel3.setText(bundle.getString("bornColumn")); // NOI18N

        jLabel4.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel4.setText(bundle.getString("levelColumn")); // NOI18N

        jLabel5.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel5.setText(bundle.getString("noteColumn")); // NOI18N

        jScrollPane1.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jScrollPane1.setMinimumSize(new java.awt.Dimension(0, 0));
        jScrollPane1.setPreferredSize(new java.awt.Dimension(205, 73));

        addAgentDialogNote.setColumns(18);
        addAgentDialogNote.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        addAgentDialogNote.setLineWrap(true);
        addAgentDialogNote.setRows(5);
        jScrollPane1.setViewportView(addAgentDialogNote);

        agentDialogAddAgentButton.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        agentDialogAddAgentButton.setText(bundle.getString("addAgent")); // NOI18N
        agentDialogAddAgentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                agentDialogAddAgentButtonActionPerformed(evt);
            }
        });

        jButton8.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        jButton8.setText(bundle.getString("cancel")); // NOI18N
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        addAgentDialogLevel.setModel(new javax.swing.DefaultComboBoxModel(
                new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));

        addAgentDialogBorn.setDateFormatString(bundle.getString("dateFormat")); // NOI18N
        addAgentDialogBorn.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(jPanel4Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup().addGap(25, 25, 25).addGroup(jPanel4Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel4Layout.createSequentialGroup().addGap(11, 11, 11)
                                .addComponent(agentDialogAddAgentButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        107, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(39, 39, 39)
                                .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 95,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                        .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel4Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                jPanel4Layout.createSequentialGroup().addComponent(jLabel1)
                                                        .addGap(9, 9, 9))
                                        .addGroup(jPanel4Layout.createSequentialGroup().addComponent(jLabel3)
                                                .addGap(18, 18, 18)))
                                .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addGroup(jPanel4Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addGap(7, 7, 7)))
                                .addGroup(jPanel4Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(addAgentDialogLevel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 213,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(jPanel4Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                        false)
                                                .addComponent(addAgentDialogBorn,
                                                        javax.swing.GroupLayout.Alignment.LEADING,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(addAgentDialogName,
                                                        javax.swing.GroupLayout.Alignment.LEADING,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, 192,
                                                        Short.MAX_VALUE)))
                                .addContainerGap(25, Short.MAX_VALUE)))));
        jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(addAgentDialogName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(
                                jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addGroup(jPanel4Layout
                                                .createSequentialGroup()
                                                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 26,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(15, 15, 15))
                                        .addGroup(jPanel4Layout.createSequentialGroup()
                                                .addComponent(addAgentDialogBorn,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(addAgentDialogLevel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(12, 12, 12)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(agentDialogAddAgentButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(53, Short.MAX_VALUE)));

        javax.swing.GroupLayout addAgentDialogLayout = new javax.swing.GroupLayout(addAgentDialog.getContentPane());
        addAgentDialog.getContentPane().setLayout(addAgentDialogLayout);
        addAgentDialogLayout.setHorizontalGroup(
                addAgentDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE));
        addAgentDialogLayout.setVerticalGroup(addAgentDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(addAgentDialogLayout.createSequentialGroup()
                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 43,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE)));

        editAgentDialog.setTitle(bundle.getString("editAgent")); // NOI18N
        editAgentDialog.setAlwaysOnTop(true);
        editAgentDialog.setBackground(new java.awt.Color(0, 100, 200));
        editAgentDialog.setMinimumSize(new java.awt.Dimension(320, 370));
        editAgentDialog.setName("EditDialog"); // NOI18N

        jLabel6.setBackground(new java.awt.Color(0, 100, 200));
        jLabel6.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(255, 150, 0));
        jLabel6.setText(bundle.getString("editAgent")); // NOI18N
        jLabel6.setMaximumSize(new java.awt.Dimension(154, 29));
        jLabel6.setMinimumSize(new java.awt.Dimension(154, 29));
        jLabel6.setOpaque(true);
        jLabel6.setPreferredSize(new java.awt.Dimension(154, 29));

        jLabel7.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel7.setText(bundle.getString("nameColumn")); // NOI18N

        jLabel8.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel8.setText(bundle.getString("bornColumn")); // NOI18N

        jLabel9.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel9.setText(bundle.getString("levelColumn")); // NOI18N

        jLabel10.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel10.setText(bundle.getString("noteColumn")); // NOI18N

        editAgentDialogName.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        editAgentDialogName.setMinimumSize(new java.awt.Dimension(192, 30));

        editAgentDialogEditAgentButton.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        editAgentDialogEditAgentButton.setText(bundle.getString("editAgent")); // NOI18N
        editAgentDialogEditAgentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editAgentDialogEditAgentButtonActionPerformed(evt);
            }
        });

        jScrollPane4.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jScrollPane4.setMinimumSize(new java.awt.Dimension(0, 0));
        jScrollPane4.setPreferredSize(new java.awt.Dimension(205, 73));

        editAgentDialogNote.setColumns(18);
        editAgentDialogNote.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        editAgentDialogNote.setLineWrap(true);
        editAgentDialogNote.setRows(5);
        jScrollPane4.setViewportView(editAgentDialogNote);

        jButton7.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        jButton7.setText(bundle.getString("cancel")); // NOI18N
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        editAgentDialogLevel.setModel(new javax.swing.DefaultComboBoxModel(
                new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));

        editAgentDialogBorn.setDateFormatString(bundle.getString("dateFormat")); // NOI18N
        editAgentDialogBorn.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(jPanel5Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel5Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
                                .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(
                                jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(editAgentDialogName, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, 204, Short.MAX_VALUE)
                                        .addComponent(editAgentDialogLevel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(editAgentDialogBorn, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(jPanel5Layout.createSequentialGroup().addGap(35, 35, 35)
                        .addComponent(editAgentDialogEditAgentButton, javax.swing.GroupLayout.PREFERRED_SIZE, 107,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 94,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(37, 37, 37)));
        jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup().addGap(24, 24, 24)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(editAgentDialogName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(13, 13, 13)
                        .addGroup(jPanel5Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 27,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(editAgentDialogBorn, javax.swing.GroupLayout.DEFAULT_SIZE, 33,
                                        Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(editAgentDialogLevel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
                        .addGroup(
                                jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(editAgentDialogEditAgentButton,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                                        .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(25, 25, 25)));

        javax.swing.GroupLayout editAgentDialogLayout = new javax.swing.GroupLayout(
                editAgentDialog.getContentPane());
        editAgentDialog.getContentPane().setLayout(editAgentDialogLayout);
        editAgentDialogLayout.setHorizontalGroup(editAgentDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE));
        editAgentDialogLayout.setVerticalGroup(editAgentDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(editAgentDialogLayout.createSequentialGroup()
                        .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 43,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel5,
                                javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)));

        deleteAgentDialog.setTitle(bundle.getString("deleteAgent")); // NOI18N
        deleteAgentDialog.setAlwaysOnTop(true);
        deleteAgentDialog.setMinimumSize(new java.awt.Dimension(444, 210));
        deleteAgentDialog.setModal(true);
        deleteAgentDialog.setName("deleteAgentDialog"); // NOI18N

        jLabel11.setBackground(new java.awt.Color(0, 100, 200));
        jLabel11.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(255, 150, 0));
        jLabel11.setText(bundle.getString("deleteAgent")); // NOI18N
        jLabel11.setOpaque(true);

        deleteAgentDialogSureCheck.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        deleteAgentDialogSureCheck.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        deleteAgentDialogSureCheck.setText(bundle.getString("deleteAgentSureCheck")); // NOI18N
        deleteAgentDialogSureCheck.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel13.setText(bundle.getString("deleteAgentSureInfo")); // NOI18N

        deleteAgentDialogDeleteButton.setText(bundle.getString("delete")); // NOI18N
        deleteAgentDialogDeleteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteAgentDialogDeleteButtonActionPerformed(evt);
            }
        });

        jButton4.setText(bundle.getString("cancel")); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout
                .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap(96, Short.MAX_VALUE)
                                .addComponent(deleteAgentDialogDeleteButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        82, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(88, 88, 88)
                                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 85,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(93, 93, 93))
                        .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                        .addComponent(deleteAgentDialogSureCheck, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
        jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                        .addComponent(deleteAgentDialogSureCheck)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel13)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(deleteAgentDialogDeleteButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(33, Short.MAX_VALUE)));

        javax.swing.GroupLayout deleteAgentDialogLayout = new javax.swing.GroupLayout(
                deleteAgentDialog.getContentPane());
        deleteAgentDialog.getContentPane().setLayout(deleteAgentDialogLayout);
        deleteAgentDialogLayout.setHorizontalGroup(deleteAgentDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        deleteAgentDialogLayout.setVerticalGroup(
                deleteAgentDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(deleteAgentDialogLayout.createSequentialGroup()
                                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 51,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        findAgentDialog.setTitle(bundle.getString("findAgent")); // NOI18N
        findAgentDialog.setAlwaysOnTop(true);
        findAgentDialog.setMinimumSize(new java.awt.Dimension(400, 225));

        jLabel14.setBackground(new java.awt.Color(0, 100, 200));
        jLabel14.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel14.setForeground(new java.awt.Color(255, 150, 0));
        jLabel14.setText(bundle.getString("findAgent")); // NOI18N
        jLabel14.setOpaque(true);

        jLabel15.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel15.setText(bundle.getString("selectAgent")); // NOI18N

        findAgentDialogComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        findAgentDialogComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAgentDialogComboBoxActionPerformed(evt);
            }
        });

        findAgentDialogFindAgentbutton.setText(bundle.getString("findAgent")); // NOI18N
        findAgentDialogFindAgentbutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAgentDialogFindAgentbuttonActionPerformed(evt);
            }
        });

        jButton6.setText(bundle.getString("cancel")); // NOI18N
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(jPanel7Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel7Layout.createSequentialGroup().addGroup(jPanel7Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel7Layout.createSequentialGroup().addGap(44, 44, 44)
                                .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 120,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(27, 27, 27).addComponent(findAgentDialogComboBox,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel7Layout.createSequentialGroup().addGap(74, 74, 74)
                                .addComponent(findAgentDialogFindAgentbutton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 99,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(50, 50, 50).addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(36, Short.MAX_VALUE)));
        jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel7Layout.createSequentialGroup().addGap(24, 24, 24)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(findAgentDialogComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(findAgentDialogFindAgentbutton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(60, Short.MAX_VALUE)));

        javax.swing.GroupLayout findAgentDialogLayout = new javax.swing.GroupLayout(
                findAgentDialog.getContentPane());
        findAgentDialog.getContentPane().setLayout(findAgentDialogLayout);
        findAgentDialogLayout.setHorizontalGroup(findAgentDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        findAgentDialogLayout.setVerticalGroup(findAgentDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(findAgentDialogLayout.createSequentialGroup()
                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)));

        addMissionDialog.setTitle(bundle.getString("addMission")); // NOI18N
        addMissionDialog.setAlwaysOnTop(true);
        addMissionDialog.setMinimumSize(new java.awt.Dimension(375, 415));

        jPanel8.setPreferredSize(new java.awt.Dimension(461, 300));

        jLabel16.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel16.setText(bundle.getString("beginDateColumn")); // NOI18N

        jLabel17.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel17.setText(bundle.getString("endDateColumn")); // NOI18N

        jLabel18.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel18.setText(bundle.getString("difficultyColumn")); // NOI18N

        jLabel19.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel19.setText(bundle.getString("noteColumn")); // NOI18N

        jScrollPane5.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jScrollPane5.setMinimumSize(new java.awt.Dimension(0, 0));
        jScrollPane5.setPreferredSize(new java.awt.Dimension(205, 73));

        addMissionDialogNote.setColumns(18);
        addMissionDialogNote.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        addMissionDialogNote.setLineWrap(true);
        addMissionDialogNote.setRows(5);
        jScrollPane5.setViewportView(addMissionDialogNote);

        add.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        add.setText(bundle.getString("addMission")); // NOI18N
        add.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addActionPerformed(evt);
            }
        });

        jButton10.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        jButton10.setText(bundle.getString("cancel")); // NOI18N
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        jLabel21.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel21.setText(bundle.getString("capacityColumn")); // NOI18N

        addMissionDialogCapacity.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        addMissionDialogCapacity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addMissionDialogCapacityActionPerformed(evt);
            }
        });

        jLabel33.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel33.setText(bundle.getString("nameColumn")); // NOI18N

        addMissionDialogName.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        addMissionDialogName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addMissionDialogNameActionPerformed(evt);
            }
        });

        addMissionDialogDifficulty.setModel(new javax.swing.DefaultComboBoxModel(
                new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
        addMissionDialogDifficulty.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addMissionDialogDifficultyActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(jPanel8Layout.createParallelGroup(
                javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                        jPanel8Layout.createSequentialGroup().addGap(35, 35, 35).addGroup(jPanel8Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                                        jPanel8Layout.createSequentialGroup().addGap(30, 30, 30).addComponent(add)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 95,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(222, 222, 222))
                                .addGroup(
                                        jPanel8Layout.createSequentialGroup()
                                                .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addGap(422, 422, 422))
                                .addGroup(jPanel8Layout.createSequentialGroup().addComponent(jLabel21).addGap(0, 0,
                                        Short.MAX_VALUE))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                        jPanel8Layout.createSequentialGroup()
                                                .addComponent(jLabel18, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addGap(422, 422, 422))))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                        jPanel8Layout.createSequentialGroup().addGap(34, 34, 34)
                                .addGroup(jPanel8Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel8Layout.createSequentialGroup().addGroup(jPanel8Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel16).addComponent(jLabel17)).addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                                        .addGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                jPanel8Layout.createSequentialGroup().addComponent(jLabel33)
                                                        .addGap(47, 47, 47)))
                                .addGroup(jPanel8Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(addMissionDialogName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                205, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(jPanel8Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                        false)
                                                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(addMissionDialogCapacity)
                                                .addComponent(addMissionDialogDifficulty,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(addMissionDialogBeginDate,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(addMissionDialogEndDate,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                .addGap(211, 211, 211)));
        jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel8Layout.createSequentialGroup().addGap(20, 20, 20).addGroup(jPanel8Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel33)
                        .addComponent(addMissionDialogName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(8, 8, 8)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel16).addComponent(addMissionDialogBeginDate,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 27,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(
                                jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 26,
                                                Short.MAX_VALUE)
                                        .addComponent(addMissionDialogEndDate, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(8, 8, 8)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(addMissionDialogDifficulty, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        25, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(addMissionDialogCapacity, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(7, 7, 7)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(
                                jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(add, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(45, Short.MAX_VALUE)));

        jLabel20.setBackground(new java.awt.Color(0, 100, 200));
        jLabel20.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
        jLabel20.setForeground(new java.awt.Color(255, 150, 0));
        jLabel20.setText(bundle.getString("addMission")); // NOI18N
        jLabel20.setOpaque(true);

        javax.swing.GroupLayout addMissionDialogLayout = new javax.swing.GroupLayout(
                addMissionDialog.getContentPane());
        addMissionDialog.getContentPane().setLayout(addMissionDialogLayout);
        addMissionDialogLayout.setHorizontalGroup(
                addMissionDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE));
        addMissionDialogLayout.setVerticalGroup(addMissionDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(addMissionDialogLayout.createSequentialGroup()
                        .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 43,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)));

        editMissionDialog.setTitle(bundle.getString("editMission")); // NOI18N
        editMissionDialog.setAlwaysOnTop(true);
        editMissionDialog.setMinimumSize(new java.awt.Dimension(375, 415));

        jLabel22.setBackground(new java.awt.Color(0, 100, 200));
        jLabel22.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
        jLabel22.setForeground(new java.awt.Color(255, 150, 0));
        jLabel22.setText(bundle.getString("editMission")); // NOI18N
        jLabel22.setOpaque(true);

        jPanel9.setPreferredSize(new java.awt.Dimension(461, 300));

        jLabel23.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel23.setText(bundle.getString("beginDateColumn")); // NOI18N

        jLabel24.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel24.setText(bundle.getString("endDateColumn")); // NOI18N

        jLabel25.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel25.setText(bundle.getString("difficultyColumn")); // NOI18N

        jLabel26.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel26.setText(bundle.getString("noteColumn")); // NOI18N

        jScrollPane6.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jScrollPane6.setMinimumSize(new java.awt.Dimension(0, 0));
        jScrollPane6.setPreferredSize(new java.awt.Dimension(205, 73));

        editMissionDialogNote.setColumns(18);
        editMissionDialogNote.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        editMissionDialogNote.setLineWrap(true);
        editMissionDialogNote.setRows(5);
        jScrollPane6.setViewportView(editMissionDialogNote);

        add1.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        add1.setText(bundle.getString("editMission")); // NOI18N
        add1.setToolTipText("");
        add1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                add1ActionPerformed(evt);
            }
        });

        jButton11.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
        jButton11.setText(bundle.getString("cancel")); // NOI18N
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jLabel27.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel27.setText(bundle.getString("capacityColumn")); // NOI18N

        editMissionDialogCapacity.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        editMissionDialogCapacity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editMissionDialogCapacityActionPerformed(evt);
            }
        });

        jLabel34.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel34.setText(bundle.getString("nameColumn")); // NOI18N

        editMissionDialogName.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        editMissionDialogName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editMissionDialogNameActionPerformed(evt);
            }
        });

        editMissionDialogDifficulty.setModel(new javax.swing.DefaultComboBoxModel(
                new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(jPanel9Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel9Layout.createSequentialGroup().addGap(30, 30, 30).addGroup(jPanel9Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                                jPanel9Layout.createSequentialGroup().addGap(1, 1, 1).addGroup(jPanel9Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel9Layout.createSequentialGroup().addGap(11, 11, 11)
                                                .addComponent(add1)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 95,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(17, 17, 17))
                                        .addGroup(jPanel9Layout.createSequentialGroup()
                                                .addComponent(jLabel25, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(editMissionDialogDifficulty,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(141, 141, 141))
                                        .addGroup(jPanel9Layout.createSequentialGroup()
                                                .addComponent(jLabel26, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanel9Layout.createSequentialGroup().addComponent(jLabel27)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(editMissionDialogCapacity,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 205,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(jPanel9Layout.createSequentialGroup().addGroup(jPanel9Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                        jPanel9Layout.createSequentialGroup().addGroup(jPanel9Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel23).addComponent(jLabel34)).addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                                .addGroup(jPanel9Layout.createSequentialGroup().addComponent(jLabel24).addGap(38,
                                        38, 38)))
                                .addGroup(jPanel9Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(editMissionDialogName, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                205, Short.MAX_VALUE)
                                        .addComponent(editMissionDialogBeginDate,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(editMissionDialogEndDate,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addGap(51, 51, 51)));
        jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(editMissionDialogName, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel34))
                        .addGap(10, 10, 10)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel23).addComponent(editMissionDialogBeginDate,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 26,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(editMissionDialogEndDate, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(8, 8, 8)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(editMissionDialogDifficulty, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        25, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(editMissionDialogCapacity, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(
                                jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(add1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap()));

        javax.swing.GroupLayout editMissionDialogLayout = new javax.swing.GroupLayout(
                editMissionDialog.getContentPane());
        editMissionDialog.getContentPane().setLayout(editMissionDialogLayout);
        editMissionDialogLayout.setHorizontalGroup(
                editMissionDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                        .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE));
        editMissionDialogLayout.setVerticalGroup(
                editMissionDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(editMissionDialogLayout.createSequentialGroup()
                                .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 43,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 330,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap()));

        deleteMissionDialog.setTitle(bundle.getString("deleteMission")); // NOI18N
        deleteMissionDialog.setAlwaysOnTop(true);
        deleteMissionDialog.setMinimumSize(new java.awt.Dimension(400, 200));

        deleteMissionDialogSureCheck.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        deleteMissionDialogSureCheck.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        deleteMissionDialogSureCheck.setText(bundle.getString("deleteMissionSureCheck")); // NOI18N

        jLabel29.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel29.setText(bundle.getString("deleteMissionSureInfo")); // NOI18N
        jLabel29.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        jButton9.setText(bundle.getString("delete")); // NOI18N
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButton12.setText(bundle.getString("cancel")); // NOI18N
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(jPanel10Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(deleteMissionDialogSureCheck, javax.swing.GroupLayout.Alignment.TRAILING,
                        javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel10Layout.createSequentialGroup().addGap(79, 79, 79)
                        .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 82,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(65, 65, 65)
                        .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 85,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(89, Short.MAX_VALUE))
                .addComponent(jLabel29, javax.swing.GroupLayout.Alignment.TRAILING,
                        javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        jPanel10Layout.setVerticalGroup(jPanel10Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel10Layout.createSequentialGroup().addContainerGap()
                        .addComponent(deleteMissionDialogSureCheck)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel29)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(42, Short.MAX_VALUE)));

        jLabel30.setBackground(new java.awt.Color(0, 100, 200));
        jLabel30.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel30.setForeground(new java.awt.Color(255, 150, 0));
        jLabel30.setText(bundle.getString("deleteMission")); // NOI18N
        jLabel30.setOpaque(true);

        javax.swing.GroupLayout deleteMissionDialogLayout = new javax.swing.GroupLayout(
                deleteMissionDialog.getContentPane());
        deleteMissionDialog.getContentPane().setLayout(deleteMissionDialogLayout);
        deleteMissionDialogLayout.setHorizontalGroup(deleteMissionDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel30, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        deleteMissionDialogLayout.setVerticalGroup(
                deleteMissionDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(deleteMissionDialogLayout.createSequentialGroup()
                                .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 51,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        findMissionDialog.setTitle(bundle.getString("findMission")); // NOI18N
        findMissionDialog.setAlwaysOnTop(true);
        findMissionDialog.setMinimumSize(new java.awt.Dimension(400, 225));

        jLabel31.setBackground(new java.awt.Color(0, 100, 200));
        jLabel31.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel31.setForeground(new java.awt.Color(255, 150, 0));
        jLabel31.setText(bundle.getString("findMission")); // NOI18N
        jLabel31.setOpaque(true);

        jLabel32.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel32.setText(bundle.getString("selectMission")); // NOI18N

        findMissionDialogComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        jButton13.setText(bundle.getString("findMission")); // NOI18N
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        jButton14.setText(bundle.getString("cancel")); // NOI18N
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(jPanel11Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel11Layout.createSequentialGroup().addGroup(jPanel11Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel11Layout.createSequentialGroup().addGap(31, 31, 31)
                                .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(27, 27, 27).addComponent(findMissionDialogComboBox,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel11Layout.createSequentialGroup().addGap(74, 74, 74).addComponent(jButton13)
                                .addGap(43, 43, 43).addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(36, Short.MAX_VALUE)));
        jPanel11Layout.setVerticalGroup(jPanel11Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel11Layout.createSequentialGroup().addGap(24, 24, 24)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(findMissionDialogComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(64, Short.MAX_VALUE)));

        javax.swing.GroupLayout findMissionDialogLayout = new javax.swing.GroupLayout(
                findMissionDialog.getContentPane());
        findMissionDialog.getContentPane().setLayout(findMissionDialogLayout);
        findMissionDialogLayout.setHorizontalGroup(findMissionDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel31, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        findMissionDialogLayout.setVerticalGroup(
                findMissionDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(findMissionDialogLayout.createSequentialGroup()
                                .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        assignDialog.setTitle(bundle.getString("assignAgentToMission")); // NOI18N
        assignDialog.setMinimumSize(new java.awt.Dimension(400, 240));

        jLabel46.setBackground(new java.awt.Color(0, 100, 200));
        jLabel46.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel46.setForeground(new java.awt.Color(255, 150, 0));
        jLabel46.setText(bundle.getString("assignAgentToMission")); // NOI18N
        jLabel46.setOpaque(true);

        jLabel47.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel47.setText(bundle.getString("selectMission")); // NOI18N

        assignDialogMissionsComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        assignAgentToMissionAssignButton.setText(bundle.getString("assign")); // NOI18N
        assignAgentToMissionAssignButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                assignAgentToMissionAssignButtonActionPerformed(evt);
            }
        });

        jButton26.setText(bundle.getString("cancel")); // NOI18N
        jButton26.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton26ActionPerformed(evt);
            }
        });

        jLabel48.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel48.setText(bundle.getString("selectAgent")); // NOI18N

        assignDialogAgentsComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(jPanel17Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel17Layout.createSequentialGroup().addGroup(jPanel17Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel17Layout.createSequentialGroup().addGap(77, 77, 77)
                                .addComponent(assignAgentToMissionAssignButton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 99,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(46, 46, 46).addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel17Layout.createSequentialGroup().addGap(31, 31, 31).addGroup(jPanel17Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel17Layout.createSequentialGroup()
                                        .addComponent(jLabel48, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34,
                                                Short.MAX_VALUE)
                                        .addComponent(assignDialogAgentsComboBox,
                                                javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel17Layout.createSequentialGroup()
                                        .addComponent(jLabel47, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(assignDialogMissionsComboBox,
                                                javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(29, 29, 29)));
        jPanel17Layout.setVerticalGroup(jPanel17Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel17Layout.createSequentialGroup().addGap(36, 36, 36).addGroup(jPanel17Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(assignDialogAgentsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel48, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(assignDialogMissionsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel47, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(assignAgentToMissionAssignButton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(21, 21, 21)));

        javax.swing.GroupLayout assignDialogLayout = new javax.swing.GroupLayout(assignDialog.getContentPane());
        assignDialog.getContentPane().setLayout(assignDialogLayout);
        assignDialogLayout.setHorizontalGroup(assignDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel46, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        assignDialogLayout
                .setVerticalGroup(assignDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(assignDialogLayout.createSequentialGroup()
                                .addComponent(jLabel46, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        withdrawDialog.setTitle(bundle.getString("withdrawAgentFromMission")); // NOI18N
        withdrawDialog.setMinimumSize(new java.awt.Dimension(400, 240));

        jLabel37.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel37.setText(bundle.getString("selectMission")); // NOI18N

        withdrawAgentFromMissionAgentComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        withdrawDialogWithdrawButton.setText(bundle.getString("withdraw")); // NOI18N
        withdrawDialogWithdrawButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                withdrawDialogWithdrawButtonActionPerformed(evt);
            }
        });

        jButton18.setText(bundle.getString("cancel")); // NOI18N
        jButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton18ActionPerformed(evt);
            }
        });

        jLabel45.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel45.setText(bundle.getString("selectAgent")); // NOI18N

        withdrawAgentFromMissionMissionComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(jPanel13Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel13Layout.createSequentialGroup().addGroup(jPanel13Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel13Layout.createSequentialGroup().addGap(77, 77, 77)
                                .addComponent(withdrawDialogWithdrawButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        99, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(46, 46, 46).addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel13Layout.createSequentialGroup().addGap(31, 31, 31)
                                .addGroup(jPanel13Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel13Layout.createSequentialGroup()
                                                .addComponent(jLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        34, Short.MAX_VALUE)
                                                .addComponent(withdrawAgentFromMissionMissionComboBox,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanel13Layout.createSequentialGroup()
                                                .addComponent(jLabel45, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(withdrawAgentFromMissionAgentComboBox,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addGap(29, 29, 29)));
        jPanel13Layout.setVerticalGroup(jPanel13Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel13Layout.createSequentialGroup().addGap(24, 24, 24)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(withdrawAgentFromMissionMissionComboBox,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel45, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(withdrawAgentFromMissionAgentComboBox,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(withdrawDialogWithdrawButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(21, 21, 21)));

        jLabel38.setBackground(new java.awt.Color(0, 100, 200));
        jLabel38.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel38.setForeground(new java.awt.Color(255, 150, 0));
        jLabel38.setText(bundle.getString("withdrawAgentFromMission")); // NOI18N
        jLabel38.setOpaque(true);

        javax.swing.GroupLayout withdrawDialogLayout = new javax.swing.GroupLayout(withdrawDialog.getContentPane());
        withdrawDialog.getContentPane().setLayout(withdrawDialogLayout);
        withdrawDialogLayout.setHorizontalGroup(withdrawDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel38, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        withdrawDialogLayout.setVerticalGroup(
                withdrawDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(withdrawDialogLayout.createSequentialGroup()
                                .addComponent(jLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        agentsOnMissionDialog.setTitle(bundle.getString("findAgentsOnMission")); // NOI18N
        agentsOnMissionDialog.setMinimumSize(new java.awt.Dimension(400, 225));

        jLabel39.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel39.setText(bundle.getString("selectMission")); // NOI18N

        findAgentsOnMissionComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        findAgentsFindButton.setText(bundle.getString("find")); // NOI18N
        findAgentsFindButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAgentsFindButtonActionPerformed(evt);
            }
        });

        jButton20.setText(bundle.getString("cancel")); // NOI18N
        jButton20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton20ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(jPanel14Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel14Layout.createSequentialGroup().addGroup(jPanel14Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel14Layout.createSequentialGroup().addGap(31, 31, 31)
                                .addComponent(jLabel39, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(27, 27, 27).addComponent(findAgentsOnMissionComboBox,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel14Layout.createSequentialGroup().addGap(74, 74, 74)
                                .addComponent(findAgentsFindButton, javax.swing.GroupLayout.PREFERRED_SIZE, 99,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(50, 50, 50).addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(36, Short.MAX_VALUE)));
        jPanel14Layout.setVerticalGroup(jPanel14Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel14Layout.createSequentialGroup().addGap(24, 24, 24)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel39, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(findAgentsOnMissionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(findAgentsFindButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(64, Short.MAX_VALUE)));

        jLabel40.setBackground(new java.awt.Color(0, 100, 200));
        jLabel40.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel40.setForeground(new java.awt.Color(255, 150, 0));
        jLabel40.setText(bundle.getString("findAgentsOnMission")); // NOI18N
        jLabel40.setOpaque(true);

        javax.swing.GroupLayout agentsOnMissionDialogLayout = new javax.swing.GroupLayout(
                agentsOnMissionDialog.getContentPane());
        agentsOnMissionDialog.getContentPane().setLayout(agentsOnMissionDialogLayout);
        agentsOnMissionDialogLayout.setHorizontalGroup(agentsOnMissionDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel40, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        agentsOnMissionDialogLayout.setVerticalGroup(
                agentsOnMissionDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(agentsOnMissionDialogLayout.createSequentialGroup()
                                .addComponent(jLabel40, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        missionWithAgentDialog.setTitle(bundle.getString("findMissionWithAgent")); // NOI18N
        missionWithAgentDialog.setMinimumSize(new java.awt.Dimension(400, 225));

        jLabel41.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel41.setText(bundle.getString("selectAgent")); // NOI18N

        findMissionWithAgentComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        jButton21.setText(bundle.getString("findMission")); // NOI18N
        jButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton21ActionPerformed(evt);
            }
        });

        jButton22.setText(bundle.getString("cancel")); // NOI18N
        jButton22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton22ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(jPanel15Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel15Layout.createSequentialGroup().addGroup(jPanel15Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel15Layout.createSequentialGroup().addGap(31, 31, 31)
                                .addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(27, 27, 27).addComponent(findMissionWithAgentComboBox,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel15Layout.createSequentialGroup().addGap(49, 49, 49)
                                .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 124,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(50, 50, 50).addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(36, Short.MAX_VALUE)));
        jPanel15Layout.setVerticalGroup(jPanel15Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel15Layout.createSequentialGroup().addGap(24, 24, 24)
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(findMissionWithAgentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(64, Short.MAX_VALUE)));

        jLabel42.setBackground(new java.awt.Color(0, 100, 200));
        jLabel42.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel42.setForeground(new java.awt.Color(255, 150, 0));
        jLabel42.setText(bundle.getString("findMissionWithAgent")); // NOI18N
        jLabel42.setOpaque(true);

        javax.swing.GroupLayout missionWithAgentDialogLayout = new javax.swing.GroupLayout(
                missionWithAgentDialog.getContentPane());
        missionWithAgentDialog.getContentPane().setLayout(missionWithAgentDialogLayout);
        missionWithAgentDialogLayout.setHorizontalGroup(missionWithAgentDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel42, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        missionWithAgentDialogLayout.setVerticalGroup(
                missionWithAgentDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(missionWithAgentDialogLayout.createSequentialGroup()
                                .addComponent(jLabel42, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        availableAgentsDialog.setTitle(bundle.getString("findAvailableAgentsForMission")); // NOI18N
        availableAgentsDialog.setMinimumSize(new java.awt.Dimension(400, 225));

        jLabel43.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel43.setText(bundle.getString("selectMission")); // NOI18N

        findAvailableAgentsComboBox.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N

        findAvailableAgentsFindButton.setText(bundle.getString("find")); // NOI18N
        findAvailableAgentsFindButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAvailableAgentsFindButtonActionPerformed(evt);
            }
        });

        jButton24.setText(bundle.getString("cancel")); // NOI18N
        jButton24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton24ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(jPanel16Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel16Layout.createSequentialGroup().addGroup(jPanel16Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel16Layout.createSequentialGroup().addGap(31, 31, 31)
                                .addComponent(jLabel43, javax.swing.GroupLayout.PREFERRED_SIZE, 133,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(27, 27, 27).addComponent(findAvailableAgentsComboBox,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 173,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel16Layout.createSequentialGroup().addGap(74, 74, 74)
                                .addComponent(findAvailableAgentsFindButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        99, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(50, 50, 50).addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(36, Short.MAX_VALUE)));
        jPanel16Layout.setVerticalGroup(jPanel16Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel16Layout.createSequentialGroup().addGap(24, 24, 24)
                        .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel43, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(findAvailableAgentsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(findAvailableAgentsFindButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(64, Short.MAX_VALUE)));

        jLabel44.setBackground(new java.awt.Color(0, 100, 200));
        jLabel44.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel44.setForeground(new java.awt.Color(255, 150, 0));
        jLabel44.setText(bundle.getString("findAvailableAgentsForMission")); // NOI18N
        jLabel44.setOpaque(true);

        javax.swing.GroupLayout availableAgentsDialogLayout = new javax.swing.GroupLayout(
                availableAgentsDialog.getContentPane());
        availableAgentsDialog.getContentPane().setLayout(availableAgentsDialogLayout);
        availableAgentsDialogLayout.setHorizontalGroup(availableAgentsDialogLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel44, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        availableAgentsDialogLayout.setVerticalGroup(
                availableAgentsDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(availableAgentsDialogLayout.createSequentialGroup()
                                .addComponent(jLabel44, javax.swing.GroupLayout.PREFERRED_SIZE, 49,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        agentListTable.setTitle("Agent List");
        agentListTable.setLocationByPlatform(true);
        agentListTable.setMinimumSize(new java.awt.Dimension(648, 307));

        scrollpane.setViewportView(agentListAgentTable);

        findAgentsLabel.setBackground(new java.awt.Color(0, 100, 200));
        findAgentsLabel.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
        findAgentsLabel.setForeground(new java.awt.Color(255, 150, 0));
        findAgentsLabel.setText(bundle.getString("agentsForMission")); // NOI18N
        findAgentsLabel.setOpaque(true);

        javax.swing.GroupLayout agentListTableLayout = new javax.swing.GroupLayout(agentListTable.getContentPane());
        agentListTable.getContentPane().setLayout(agentListTableLayout);
        agentListTableLayout.setHorizontalGroup(
                agentListTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(scrollpane, javax.swing.GroupLayout.DEFAULT_SIZE, 648, Short.MAX_VALUE)
                        .addComponent(findAgentsLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
        agentListTableLayout.setVerticalGroup(
                agentListTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                        javax.swing.GroupLayout.Alignment.TRAILING,
                        agentListTableLayout.createSequentialGroup()
                                .addComponent(findAgentsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 58,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(scrollpane, javax.swing.GroupLayout.PREFERRED_SIZE, 243,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)));

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Agency");
        setAutoRequestFocus(false);
        setBackground(new java.awt.Color(100, 100, 100));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setFocusTraversalPolicyProvider(true);
        setLocationByPlatform(true);
        setMinimumSize(new java.awt.Dimension(300, 200));
        setName("Main"); // NOI18N
        setResizable(false);

        jLayeredPane1.setBackground(new java.awt.Color(150, 150, 150));
        jLayeredPane1.setOpaque(true);
        jLayeredPane1.setPreferredSize(new java.awt.Dimension(800, 528));

        jTabbedPane2.setBackground(new java.awt.Color(100, 100, 100));
        jTabbedPane2.setFocusable(false);
        jTabbedPane2.setName(""); // NOI18N

        jPanel1.setBackground(new java.awt.Color(100, 100, 100));
        jPanel1.setPreferredSize(new java.awt.Dimension(932, 530));

        addAgentButton.setText(bundle.getString("addAgent")); // NOI18N
        addAgentButton.setName("addAgentButton"); // NOI18N
        addAgentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addAgentButtonActionPerformed(evt);
            }
        });

        editAgentButton.setText(bundle.getString("editAgent")); // NOI18N
        editAgentButton.setName("editAgentButton"); // NOI18N
        editAgentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editAgentButtonActionPerformed(evt);
            }
        });

        deleteAgentButton.setText(bundle.getString("deleteAgent")); // NOI18N
        deleteAgentButton.setName("deleteAgentButton"); // NOI18N
        deleteAgentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteAgentButtonActionPerformed(evt);
            }
        });

        findAgentButton.setText(bundle.getString("findAgent")); // NOI18N
        findAgentButton.setName("findAgentButton"); // NOI18N
        findAgentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAgentButtonActionPerformed(evt);
            }
        });

        agentsTable.setModel(new AgentsTableModel(missionManager));
        jScrollPane2.setViewportView(agentsTable);
        if (agentsTable.getColumnModel().getColumnCount() > 0) {
            agentsTable.getColumnModel().getColumn(0).setResizable(false);
            agentsTable.getColumnModel().getColumn(1).setResizable(false);
            agentsTable.getColumnModel().getColumn(2).setResizable(false);
            agentsTable.getColumnModel().getColumn(3).setResizable(false);
        }

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(jPanel1Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(addAgentButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(editAgentButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(deleteAgentButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(findAgentButton)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 953, Short.MAX_VALUE));
        jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(addAgentButton).addComponent(editAgentButton)
                                .addComponent(deleteAgentButton).addComponent(findAgentButton))
                        .addContainerGap()));

        jTabbedPane2.addTab("Agents table", jPanel1);

        jPanel2.setBackground(new java.awt.Color(100, 100, 100));

        missionsTable.setModel(new MissionsTableModel());
        missionsTable.getTableHeader().setReorderingAllowed(false);
        jScrollPane3.setViewportView(missionsTable);

        addMissionButton.setText(bundle.getString("addMission")); // NOI18N
        addMissionButton.setName("addMissionButton"); // NOI18N
        addMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addMissionButtonActionPerformed(evt);
            }
        });

        editMissionButton.setText(bundle.getString("editMission")); // NOI18N
        editMissionButton.setName("editMissionButton"); // NOI18N
        editMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editMissionButtonActionPerformed(evt);
            }
        });

        deleteMissionButton.setText(bundle.getString("deleteMission")); // NOI18N
        deleteMissionButton.setName("deleteMissionButton"); // NOI18N
        deleteMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteMissionButtonActionPerformed(evt);
            }
        });

        findMissionButton.setText(bundle.getString("findMission")); // NOI18N
        findMissionButton.setName("findMissionButton"); // NOI18N
        findMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findMissionButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(jPanel2Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane3)
                .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(addMissionButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(editMissionButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(deleteMissionButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(findMissionButton).addContainerGap(544, Short.MAX_VALUE)));
        jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(findMissionButton).addComponent(deleteMissionButton)
                                .addComponent(editMissionButton).addComponent(addMissionButton))
                        .addContainerGap()));

        jTabbedPane2.addTab("Missions table", jPanel2);

        javax.swing.GroupLayout jLayeredPane1Layout = new javax.swing.GroupLayout(jLayeredPane1);
        jLayeredPane1.setLayout(jLayeredPane1Layout);
        jLayeredPane1Layout.setHorizontalGroup(jLayeredPane1Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane2));
        jLayeredPane1Layout
                .setVerticalGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTabbedPane2, javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE, 391, Short.MAX_VALUE));
        jLayeredPane1.setLayer(jTabbedPane2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Title.setBackground(new java.awt.Color(0, 100, 200));
        Title.setFont(new java.awt.Font("Utopia", 1, 48)); // NOI18N
        Title.setForeground(new java.awt.Color(255, 150, 0));
        Title.setText(bundle.getString("agency")); // NOI18N
        Title.setToolTipText("");
        Title.setOpaque(true);

        jPanel3.setBackground(new java.awt.Color(0, 100, 200));

        assignAgentToMissionButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        assignAgentToMissionButton.setText(bundle.getString("assignAgentToMission")); // NOI18N
        assignAgentToMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                assignAgentToMissionButtonActionPerformed(evt);
            }
        });

        findAgentsOnMissionButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        findAgentsOnMissionButton.setText(bundle.getString("findAgentsOnMission")); // NOI18N
        findAgentsOnMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAgentsOnMissionButtonActionPerformed(evt);
            }
        });

        findMissionWithAgentButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        findMissionWithAgentButton.setText(bundle.getString("findMissionWithAgent")); // NOI18N
        findMissionWithAgentButton.setToolTipText("");
        findMissionWithAgentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findMissionWithAgentButtonActionPerformed(evt);
            }
        });

        findAvailableAgentsButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        findAvailableAgentsButton.setText(bundle.getString("findAvailableAgents")); // NOI18N
        findAvailableAgentsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAvailableAgentsButtonActionPerformed(evt);
            }
        });

        withdrawAgentFromMissionButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        withdrawAgentFromMissionButton.setText(bundle.getString("withdrawAgentFromMission")); // NOI18N
        withdrawAgentFromMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                withdrawAgentFromMissionButtonActionPerformed(evt);
            }
        });

        findAvailableAgentsForMissionButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        findAvailableAgentsForMissionButton.setText(bundle.getString("findAvailableAgentsForMission")); // NOI18N
        findAvailableAgentsForMissionButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findAvailableAgentsForMissionButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(jPanel3Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addGap(21, 21, 21)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(assignAgentToMissionButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        300, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(withdrawAgentFromMissionButton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE, 300,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(findMissionWithAgentButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        300, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(findAgentsOnMissionButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        300, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(findAvailableAgentsForMissionButton,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
                                .addComponent(findAvailableAgentsButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(
                                assignAgentToMissionButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(findAgentsOnMissionButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(findAvailableAgentsButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(withdrawAgentFromMissionButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        30, Short.MAX_VALUE)
                                .addComponent(findMissionWithAgentButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(findAvailableAgentsForMissionButton,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE))
                        .addContainerGap()));

        jMenuBar1.setName("AgentsTable"); // NOI18N

        jMenu1.setText(bundle.getString("file")); // NOI18N

        exitMenuItem.setText(bundle.getString("exit")); // NOI18N
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        jMenu1.add(exitMenuItem);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(bundle.getString("edit")); // NOI18N
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout.createSequentialGroup().addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 973,
                                        Short.MAX_VALUE)
                                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())
                .addComponent(Title, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                        .addComponent(Title, javax.swing.GroupLayout.PREFERRED_SIZE, 73,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 391, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)));

        pack();
    }// </editor-fold>//GEN-END:initComponents

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

        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        List<Mission> missions = model.getAllRows();
        findMissionDialogComboBox.setModel(new DefaultComboBoxModel(missions.toArray()));

        findMissionDialog.setVisible(true);
        findMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_findMissionButtonActionPerformed

    private void addAgentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addAgentButtonActionPerformed
        addAgentDialogReset();
        addAgentDialog.setVisible(true);
        addAgentDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_addAgentButtonActionPerformed

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void editAgentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editAgentButtonActionPerformed
        AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

        int agentRow = agentsTable.getSelectedRow();
        if (agentRow == -1) {
            showErrorDialog(ResourceBundle.getBundle("strings").getString("agentNotSelectedEdit"));
            return;
        }

        Agent agent = model.getSelectedAgent(agentRow);

        editAgentDialogReset(agent);
        editAgentDialog.setVisible(true);
        editAgentDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_editAgentButtonActionPerformed

    private void editAgentDialogEditAgentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editAgentDialogEditAgentButtonActionPerformed
        AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

        Agent agent = model.getSelectedAgent(agentsTable.getSelectedRow());
        agent.setName(editAgentDialogName.getText());
        agent.setBorn(editAgentDialogBorn.getDate());
        agent.setLevel(Integer.parseInt((String) editAgentDialogLevel.getSelectedItem()));
        agent.setNote(editAgentDialogNote.getText());

        try {
            agentSwingWorker = new AgentSwingWorker(agent, TableOperations.EDIT);
            agentSwingWorker.execute();
        } catch (IllegalArgumentException ex) {
            log.error("Edit agent exception", ex);
            showErrorDialog(ex.getMessage());
            return;
        }
    }//GEN-LAST:event_editAgentDialogEditAgentButtonActionPerformed

    private void deleteAgentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteAgentButtonActionPerformed
        AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

        int agentRow = agentsTable.getSelectedRow();
        if (agentRow == -1) {
            showErrorDialog(ResourceBundle.getBundle("strings").getString("agentNotSelectedDelete"));
            return;
        }

        Agent agent = model.getSelectedAgent(agentRow);

        deleteAgentDialogSureCheck.setText(ResourceBundle.getBundle("strings").getString("deleteAgentSureCheck")
                + " \"" + agent.getName() + "\" ?");
        deleteAgentDialog.setVisible(true);
        deleteAgentDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_deleteAgentButtonActionPerformed

    private void deleteAgentDialogDeleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteAgentDialogDeleteButtonActionPerformed
        AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

        Agent agent = model.getSelectedAgent(agentsTable.getSelectedRow());

        try {
            agentSwingWorker = new AgentSwingWorker(agent, TableOperations.DELETE);
            agentSwingWorker.execute();
        } catch (IllegalArgumentException ex) {
            log.error("Delete agent exception", ex);
            showErrorDialog(ex.getMessage());
            return;
        }
    }//GEN-LAST:event_deleteAgentDialogDeleteButtonActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        deleteAgentDialog.setVisible(false);
    }//GEN-LAST:event_jButton4ActionPerformed

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

        //not neccessary call to findAllAgents(), too expensive DB operation if many records of agents are stored in DB
        AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

        List<Agent> agents = model.getAllRows();
        findAgentDialogComboBox.setModel(new DefaultComboBoxModel(agents.toArray()));

        findAgentDialog.setVisible(true);
        findAgentDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_findAgentButtonActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        findAgentDialog.setVisible(false);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        editAgentDialog.setVisible(false);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addActionPerformed
        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        Mission mission = new Mission();
        mission.setName(addMissionDialogName.getText());
        mission.setBeginDate(addMissionDialogBeginDate.getDate());
        mission.setEndDate(addMissionDialogEndDate.getDate());
        mission.setDifficulty(Integer.parseInt((String) addMissionDialogDifficulty.getSelectedItem()));
        try {
            mission.setCapacity(Integer.parseInt(addMissionDialogCapacity.getText()));
        } catch (NumberFormatException ex) {
            log.error("Add mission error", ex);
            showErrorDialog(ResourceBundle.getBundle("strings").getString("numberFormatExc"));
            return;
        }
        mission.setNote(addMissionDialogNote.getText());

        try {
            missionSwingWorker = new MissionSwingWorker(mission, TableOperations.ADD);
            missionSwingWorker.execute();
        } catch (IllegalArgumentException ex) {
            log.error("Add mision exception", ex);
            showErrorDialog(ex.getMessage());
            return;
        }

        model.addMission(mission);
        addMissionDialog.setVisible(false);
    }//GEN-LAST:event_addActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        addMissionDialog.setVisible(false);
    }//GEN-LAST:event_jButton10ActionPerformed

    private void add1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_add1ActionPerformed
        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        Mission mission = model.getSelectedMission(missionsTable.getSelectedRow());
        mission.setName(editMissionDialogName.getText());
        mission.setBeginDate(editMissionDialogBeginDate.getDate());
        mission.setEndDate(editMissionDialogEndDate.getDate());
        mission.setDifficulty(Integer.parseInt((String) editMissionDialogDifficulty.getSelectedItem()));
        try {
            mission.setCapacity(Integer.parseInt(editMissionDialogCapacity.getText()));
        } catch (NumberFormatException ex) {
            log.error("Edit mission error", ex);
            showErrorDialog(ResourceBundle.getBundle("strings").getString("numberFormatExc"));
            return;
        }
        mission.setNote(editMissionDialogNote.getText());

        try {
            missionSwingWorker = new MissionSwingWorker(mission, TableOperations.EDIT);
            missionSwingWorker.execute();
        } catch (IllegalArgumentException ex) {
            log.error("Edit mision exception", ex);
            showErrorDialog(ex.getMessage());
            return;
        }

        model.fireTableDataChanged();
        editMissionDialog.setVisible(false);
    }//GEN-LAST:event_add1ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        editMissionDialog.setVisible(false);
    }//GEN-LAST:event_jButton11ActionPerformed

    private void editMissionDialogCapacityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editMissionDialogCapacityActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_editMissionDialogCapacityActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        Mission mission = model.getSelectedMission(missionsTable.getSelectedRow());

        try {
            missionSwingWorker = new MissionSwingWorker(mission, TableOperations.DELETE);
            missionSwingWorker.execute();
        } catch (IllegalArgumentException ex) {
            log.error("Delete mission exception", ex);
            showErrorDialog(ex.getMessage());
            return;
        }

        //table refresh
        model.removeMission(mission);
        deleteMissionDialog.setVisible(false);
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        deleteMissionDialog.setVisible(false);
    }//GEN-LAST:event_jButton12ActionPerformed

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
        findMissionDialog.setVisible(false);
        findMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_jButton14ActionPerformed

    private void addMissionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addMissionButtonActionPerformed
        addMissionDialogReset();
        addMissionDialog.setVisible(true);
        addMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_addMissionButtonActionPerformed

    private void editMissionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editMissionButtonActionPerformed
        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        int missionRow = missionsTable.getSelectedRow();
        if (missionRow == -1) {
            showErrorDialog(ResourceBundle.getBundle("strings").getString("missionNotSelectedEdit"));
            return;
        }

        Mission mission = model.getSelectedMission(missionRow);

        editMissionDialogReset(mission);
        editMissionDialog.setVisible(true);
        editMissionDialog.getContentPane().setBackground(Color.GRAY);

    }//GEN-LAST:event_editMissionButtonActionPerformed

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

        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        int missionRow = missionsTable.getSelectedRow();
        if (missionRow == -1) {
            showErrorDialog(ResourceBundle.getBundle("strings").getString("missionNotSelectedDelete"));
            return;
        }

        Mission mission = model.getSelectedMission(missionRow);

        deleteMissionDialogSureCheck.setText(ResourceBundle.getBundle("strings").getString("deleteMissionSureCheck")
                + " \"" + mission.getName() + "\" ?");
        deleteMissionDialog.setVisible(true);
        deleteMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_deleteMissionButtonActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        missionsTable.setRowSelectionInterval(findMissionDialogComboBox.getSelectedIndex(),
                findMissionDialogComboBox.getSelectedIndex());
        findMissionDialog.setVisible(false);
    }//GEN-LAST:event_jButton13ActionPerformed

    private void addMissionDialogNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addMissionDialogNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addMissionDialogNameActionPerformed

    private void addMissionDialogDifficultyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addMissionDialogDifficultyActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addMissionDialogDifficultyActionPerformed

    private void editMissionDialogNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editMissionDialogNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_editMissionDialogNameActionPerformed

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

        Agent agent = (Agent) withdrawAgentFromMissionAgentComboBox.getSelectedItem();
        Mission mission = (Mission) withdrawAgentFromMissionMissionComboBox.getSelectedItem();

        try {
            agencySwingWorker = new AgencySwingWorker(agent, mission, AgencyOperations.WITHDRAW);
            agencySwingWorker.execute();
        } catch (Exception ex) {

            log.error("Withdraw agent from mission error: ", ex);
            showErrorDialog(ex.getMessage());
            return;
        }

        withdrawDialog.setVisible(false);

    }//GEN-LAST:event_withdrawDialogWithdrawButtonActionPerformed

    private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
        withdrawDialog.setVisible(false);
    }//GEN-LAST:event_jButton18ActionPerformed

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

        Mission mission = (Mission) findAgentsOnMissionComboBox.getSelectedItem();
        AgentsTableModel newModel = new AgentsTableModel((missionManager));
        AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();

        for (Agent agent : agentsModel.getAllRows()) {
            if (agent.getMissionId() == mission.getId()) {
                newModel.addAgent(agent);
            }
        }

        agentListAgentTable.setModel(newModel);

        findAgentsLabel
                .setText(ResourceBundle.getBundle("strings").getString("agentsForMission") + mission.getName());
        agentsOnMissionDialog.setVisible(false);
        agentListTable.getContentPane().setBackground(Color.GRAY);
        agentListTable.setVisible(true);

    }//GEN-LAST:event_findAgentsFindButtonActionPerformed

    private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton20ActionPerformed
        agentsOnMissionDialog.setVisible(false);
    }//GEN-LAST:event_jButton20ActionPerformed

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

        Agent agent = (Agent) findMissionWithAgentComboBox.getSelectedItem();
        MissionsTableModel model = (MissionsTableModel) missionsTable.getModel();

        if (agent.getMissionId() == 0) {
            showErrorDialog("Agent is not on any mission");
            return;
        }

        jTabbedPane2.setSelectedIndex(1);
        missionsTable.setRowSelectionInterval(model.getMissionIndex(agent.getMissionId()),
                model.getMissionIndex(agent.getMissionId()));
        missionWithAgentDialog.setVisible(false);

    }//GEN-LAST:event_jButton21ActionPerformed

    private void jButton22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton22ActionPerformed
        missionWithAgentDialog.setVisible(false);
    }//GEN-LAST:event_jButton22ActionPerformed

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

        Mission mission = (Mission) findAvailableAgentsComboBox.getSelectedItem();
        AgentsTableModel newModel = new AgentsTableModel((missionManager));
        AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();

        for (Agent agent : agentsModel.getAllRows()) {
            if (agent.getMissionId() == 0 && agent.getLevel() >= mission.getDifficulty()) {
                newModel.addAgent(agent);
            }
        }

        agentListAgentTable.setModel(newModel);

        findAgentsLabel.setText(
                ResourceBundle.getBundle("strings").getString("availableAgentsForMission") + mission.getName());
        availableAgentsDialog.setVisible(false);
        agentListTable.getContentPane().setBackground(Color.GRAY);
        agentListTable.setVisible(true);

    }//GEN-LAST:event_findAvailableAgentsFindButtonActionPerformed

    private void jButton24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton24ActionPerformed
        availableAgentsDialog.setVisible(false);
    }//GEN-LAST:event_jButton24ActionPerformed

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

        //agents
        AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();

        List<Agent> agents = agentsModel.getAllRows();
        assignDialogAgentsComboBox.setModel(new DefaultComboBoxModel(agents.toArray()));

        //missions
        MissionsTableModel missionsModel = (MissionsTableModel) missionsTable.getModel();

        List<Mission> missions = missionsModel.getAllRows();
        assignDialogMissionsComboBox.setModel(new DefaultComboBoxModel(missions.toArray()));

        assignDialog.setVisible(true);
        findMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_assignAgentToMissionButtonActionPerformed

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

        AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();

        List<Agent> agents = agentsModel.getAllRows();
        withdrawAgentFromMissionAgentComboBox.setModel(new DefaultComboBoxModel(agents.toArray()));

        //missions
        MissionsTableModel missionsModel = (MissionsTableModel) missionsTable.getModel();

        List<Mission> missions = missionsModel.getAllRows();
        withdrawAgentFromMissionMissionComboBox.setModel(new DefaultComboBoxModel(missions.toArray()));

        withdrawDialog.setVisible(true);
        findMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_withdrawAgentFromMissionButtonActionPerformed

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

        MissionsTableModel missionsModel = (MissionsTableModel) missionsTable.getModel();

        List<Mission> missions = missionsModel.getAllRows();
        findAgentsOnMissionComboBox.setModel(new DefaultComboBoxModel(missions.toArray()));

        agentsOnMissionDialog.setVisible(true);
        findMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_findAgentsOnMissionButtonActionPerformed

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

        AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();

        List<Agent> agents = agentsModel.getAllRows();
        findMissionWithAgentComboBox.setModel(new DefaultComboBoxModel(agents.toArray()));

        missionWithAgentDialog.setVisible(true);
        findMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_findMissionWithAgentButtonActionPerformed

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

        AgentsTableModel newModel = new AgentsTableModel((missionManager));
        AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();

        for (Agent agent : agentsModel.getAllRows()) {
            if (agent.getMissionId() == 0) {
                newModel.addAgent(agent);
            }
        }

        agentListAgentTable.setModel(newModel);

        findAgentsLabel.setText(ResourceBundle.getBundle("strings").getString("availableAgents"));
        agentsOnMissionDialog.setVisible(false);
        agentListTable.getContentPane().setBackground(Color.GRAY);
        agentListTable.setVisible(true);
    }//GEN-LAST:event_findAvailableAgentsButtonActionPerformed

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

        MissionsTableModel missionsModel = (MissionsTableModel) missionsTable.getModel();

        List<Mission> missions = missionsModel.getAllRows();
        findAvailableAgentsComboBox.setModel(new DefaultComboBoxModel(missions.toArray()));

        availableAgentsDialog.setVisible(true);
        findMissionDialog.getContentPane().setBackground(Color.GRAY);
    }//GEN-LAST:event_findAvailableAgentsForMissionButtonActionPerformed

    private void assignAgentToMissionAssignButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignAgentToMissionAssignButtonActionPerformed
        Agent agent = (Agent) assignDialogAgentsComboBox.getSelectedItem();
        Mission mission = (Mission) assignDialogMissionsComboBox.getSelectedItem();

        try {
            agencySwingWorker = new AgencySwingWorker(agent, mission, AgencyOperations.ASSIGN);
            agencySwingWorker.execute();
        } catch (Exception ex) {

            log.error("Assign agent to mission error: ", ex);
            showErrorDialog(ex.getMessage());
            return;
        }

        assignDialog.setVisible(false);
    }//GEN-LAST:event_assignAgentToMissionAssignButtonActionPerformed

    private void jButton26ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton26ActionPerformed
        assignDialog.setVisible(false);
    }//GEN-LAST:event_jButton26ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        addAgentDialog.setVisible(false);
    }//GEN-LAST:event_jButton8ActionPerformed

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

        AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

        Agent agent = new Agent();
        agent.setName(addAgentDialogName.getText());
        agent.setBorn(addAgentDialogBorn.getDate());
        agent.setLevel(Integer.parseInt((String) addAgentDialogLevel.getSelectedItem()));
        agent.setNote(addAgentDialogNote.getText());
        agent.setMissionId(Long.valueOf(0));

        //add agent via SwingWorker
        try {
            agentSwingWorker = new AgentSwingWorker(agent, TableOperations.ADD);
            agentSwingWorker.execute();
        } catch (IllegalArgumentException ex) {
            log.error("Add agent exception", ex);
            showErrorDialog(ex.getMessage());
            return;
        }

    }//GEN-LAST:event_agentDialogAddAgentButtonActionPerformed

    private void findAgentDialogFindAgentbuttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findAgentDialogFindAgentbuttonActionPerformed
        AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

        agentsTable.setRowSelectionInterval(findAgentDialogComboBox.getSelectedIndex(),
                findAgentDialogComboBox.getSelectedIndex());
        findAgentDialog.setVisible(false);
    }//GEN-LAST:event_findAgentDialogFindAgentbuttonActionPerformed

    private void findAgentDialogComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findAgentDialogComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_findAgentDialogComboBoxActionPerformed

    private void addMissionDialogCapacityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addMissionDialogCapacityActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addMissionDialogCapacityActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(SwingGUI01.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(SwingGUI01.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(SwingGUI01.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(SwingGUI01.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SwingGUI01().setVisible(true);

            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Title;
    private javax.swing.JButton add;
    private javax.swing.JButton add1;
    private javax.swing.JButton addAgentButton;
    private javax.swing.JDialog addAgentDialog;
    private com.toedter.calendar.JDateChooser addAgentDialogBorn;
    private javax.swing.JComboBox addAgentDialogLevel;
    private javax.swing.JTextField addAgentDialogName;
    private javax.swing.JTextArea addAgentDialogNote;
    private javax.swing.JButton addMissionButton;
    private javax.swing.JDialog addMissionDialog;
    private com.toedter.calendar.JDateChooser addMissionDialogBeginDate;
    private javax.swing.JTextField addMissionDialogCapacity;
    private javax.swing.JComboBox addMissionDialogDifficulty;
    private com.toedter.calendar.JDateChooser addMissionDialogEndDate;
    private javax.swing.JTextField addMissionDialogName;
    private javax.swing.JTextArea addMissionDialogNote;
    private javax.swing.JButton agentDialogAddAgentButton;
    private javax.swing.JTable agentListAgentTable;
    private javax.swing.JDialog agentListTable;
    private javax.swing.JDialog agentsOnMissionDialog;
    private javax.swing.JTable agentsTable;
    private javax.swing.JButton assignAgentToMissionAssignButton;
    private javax.swing.JButton assignAgentToMissionButton;
    private javax.swing.JDialog assignDialog;
    private javax.swing.JComboBox assignDialogAgentsComboBox;
    private javax.swing.JComboBox assignDialogMissionsComboBox;
    private javax.swing.JDialog availableAgentsDialog;
    private javax.swing.JButton deleteAgentButton;
    private javax.swing.JDialog deleteAgentDialog;
    private javax.swing.JButton deleteAgentDialogDeleteButton;
    private javax.swing.JLabel deleteAgentDialogSureCheck;
    private javax.swing.JButton deleteMissionButton;
    private javax.swing.JDialog deleteMissionDialog;
    private javax.swing.JLabel deleteMissionDialogSureCheck;
    private javax.swing.JButton editAgentButton;
    private javax.swing.JDialog editAgentDialog;
    private com.toedter.calendar.JDateChooser editAgentDialogBorn;
    private javax.swing.JButton editAgentDialogEditAgentButton;
    private javax.swing.JComboBox editAgentDialogLevel;
    private javax.swing.JTextField editAgentDialogName;
    private javax.swing.JTextArea editAgentDialogNote;
    private javax.swing.JButton editMissionButton;
    private javax.swing.JDialog editMissionDialog;
    private com.toedter.calendar.JDateChooser editMissionDialogBeginDate;
    private javax.swing.JTextField editMissionDialogCapacity;
    private javax.swing.JComboBox editMissionDialogDifficulty;
    private com.toedter.calendar.JDateChooser editMissionDialogEndDate;
    private javax.swing.JTextField editMissionDialogName;
    private javax.swing.JTextArea editMissionDialogNote;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JButton findAgentButton;
    private javax.swing.JDialog findAgentDialog;
    private javax.swing.JComboBox findAgentDialogComboBox;
    private javax.swing.JButton findAgentDialogFindAgentbutton;
    private javax.swing.JButton findAgentsFindButton;
    private javax.swing.JLabel findAgentsLabel;
    private javax.swing.JButton findAgentsOnMissionButton;
    private javax.swing.JComboBox findAgentsOnMissionComboBox;
    private javax.swing.JButton findAvailableAgentsButton;
    private javax.swing.JComboBox findAvailableAgentsComboBox;
    private javax.swing.JButton findAvailableAgentsFindButton;
    private javax.swing.JButton findAvailableAgentsForMissionButton;
    private javax.swing.JButton findMissionButton;
    private javax.swing.JDialog findMissionDialog;
    private javax.swing.JComboBox findMissionDialogComboBox;
    private javax.swing.JButton findMissionWithAgentButton;
    private javax.swing.JComboBox findMissionWithAgentComboBox;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton18;
    private javax.swing.JButton jButton20;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton22;
    private javax.swing.JButton jButton24;
    private javax.swing.JButton jButton26;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JDialog missionWithAgentDialog;
    private javax.swing.JTable missionsTable;
    private javax.swing.JScrollPane scrollpane;
    private javax.swing.JComboBox withdrawAgentFromMissionAgentComboBox;
    private javax.swing.JButton withdrawAgentFromMissionButton;
    private javax.swing.JComboBox withdrawAgentFromMissionMissionComboBox;
    private javax.swing.JDialog withdrawDialog;
    private javax.swing.JButton withdrawDialogWithdrawButton;
    // End of variables declaration//GEN-END:variables

    private void addAgentDialogReset() {
        addAgentDialogName.setText("");
        addAgentDialogBorn.setDate(new GregorianCalendar(1980, Calendar.JANUARY, 1).getTime());

        addAgentDialogLevel.setSelectedItem(addAgentDialogLevel.getItemAt(0));
        addAgentDialogNote.setText("");
    }

    private void addMissionDialogReset() {
        addMissionDialogName.setText("");
        addMissionDialogBeginDate.setDate(new GregorianCalendar(1980, Calendar.JANUARY, 1).getTime());
        addMissionDialogEndDate.setDate(new GregorianCalendar(1980, Calendar.JANUARY, 1).getTime());
        addMissionDialogDifficulty.setSelectedItem(addAgentDialogLevel.getItemAt(0));
        addMissionDialogCapacity.setText("");
        addMissionDialogNote.setText("");
    }

    private void showErrorDialog(String errorMessage) {

        String[] choices = { "OK" };
        int response = JOptionPane.showOptionDialog(this, errorMessage,
                ResourceBundle.getBundle("strings").getString("error"), JOptionPane.DEFAULT_OPTION,
                JOptionPane.ERROR_MESSAGE, null, choices, choices[0]);
    }

    private void editAgentDialogReset(Agent agent) {
        editAgentDialogName.setText(agent.getName());
        editAgentDialogBorn.setDate(agent.getBorn());
        editAgentDialogLevel.setSelectedIndex(agent.getLevel() - 1);
        editAgentDialogNote.setText(agent.getNote());
    }

    private void editMissionDialogReset(Mission mission) {
        editMissionDialogName.setText(mission.getName());
        editMissionDialogBeginDate.setDate(mission.getBeginDate());
        editMissionDialogEndDate.setDate(mission.getEndDate());
        editMissionDialogDifficulty.setSelectedIndex(mission.getDifficulty() - 1);
        editMissionDialogCapacity.setText(Integer.toString(mission.getCapacity()));
        editMissionDialogNote.setText(mission.getNote());
    }

    private DataSource prepareDataSource() {
        Properties myconf = new Properties();
        try {
            myconf.load(Agency.class.getResourceAsStream("/myconf.properties"));
        } catch (IOException ex) {
            errorMessage = "Error opening properties file";
            log.error(errorMessage, ex);
            showErrorDialog(errorMessage);
        }

        BasicDataSource ds = new BasicDataSource();
        ds.setUrl(myconf.getProperty("jdbc.url"));
        ds.setUsername(myconf.getProperty("jdbc.user"));
        ds.setPassword(myconf.getProperty("jdbc.password"));

        return ds;
    }

    //SwingWorkers
    private enum TableOperations {

        ADD, EDIT, DELETE, FIND, ADD_ALL
    }

    private enum AgencyOperations {

        ASSIGN, WITHDRAW
    }

    private AgentSwingWorker agentSwingWorker;
    private MissionSwingWorker missionSwingWorker;
    private AgencySwingWorker agencySwingWorker;

    private class AgentSwingWorker extends SwingWorker<Void, Void> {

        private TableOperations operation;
        private Agent agent;

        public AgentSwingWorker(Agent agent, TableOperations op) {
            this.agent = agent;
            operation = op;
        }

        @Override
        protected Void doInBackground() throws Exception {

            switch (operation) {
            case ADD:
                agentManager.createAgent(agent);
                break;
            case EDIT:
                agentManager.updateAgent(agent);
                break;
            case DELETE:
                agentManager.deleteAgent(agent);
                break;
            case ADD_ALL:
                AgentsTableModel agentsModel = (AgentsTableModel) agentsTable.getModel();

                for (Agent agent : agentManager.findAllAgents()) {
                    agentsModel.addAgent(agent);
                }

                break;
            }

            return null;

        }

        @Override
        protected void done() {

            AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

            try {
                get();

                switch (operation) {
                case ADD:
                    model.addAgent(agent);
                    addAgentDialog.setVisible(false);
                    break;
                case EDIT:
                    model.fireTableDataChanged();
                    editAgentDialog.setVisible(false);
                    break;
                case DELETE:
                    model.removeAgent(agent);
                    deleteAgentDialog.setVisible(false);
                    break;
                default:
                    break;
                }

            } catch (InterruptedException ex) {
                showErrorDialog(ex.getMessage());
            } catch (ExecutionException ex) {
                showErrorDialog(ex.getMessage());
            }

        }

    }

    private class MissionSwingWorker extends SwingWorker<Void, Void> {

        private TableOperations operation;
        private Mission mission;

        public MissionSwingWorker(Mission mission, TableOperations op) {
            this.mission = mission;
            operation = op;
        }

        @Override
        protected Void doInBackground() throws Exception {

            switch (operation) {
            case ADD:
                missionManager.createMission(mission);
                break;
            case EDIT:
                missionManager.updateMission(mission);
                break;
            case DELETE:
                missionManager.deleteMission(mission);
                break;
            case ADD_ALL:

                MissionsTableModel missionsModel = (MissionsTableModel) missionsTable.getModel();

                for (Mission mission : missionManager.findAllMissions()) {
                    missionsModel.addMission(mission);
                }

                break;
            }

            return null;

        }
    }

    private class AgencySwingWorker extends SwingWorker<Void, Void> {

        private AgencyOperations operation;
        private Agent agent;
        private Mission mission;

        public AgencySwingWorker(Agent agent, Mission mission, AgencyOperations op) {
            this.agent = agent;
            this.mission = mission;
            operation = op;
        }

        @Override
        protected Void doInBackground() throws Exception {

            switch (operation) {
            case ASSIGN:
                agencyManager.assignAgentToMission(agent, mission);
                break;
            case WITHDRAW:
                agencyManager.withdrawAgentFromMission(agent, mission);
                break;
            }
            return null;

        }

        @Override
        protected void done() {
            AgentsTableModel model = (AgentsTableModel) agentsTable.getModel();

            model.fireTableDataChanged();
        }

    }
}