/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package unitselection;

/**
 *
 * @author Matt
 */
public class UnitSelectionFrame extends javax.swing.JFrame {

    /**
     * Creates new form UnitSelectionFrame
     */
    public UnitSelectionFrame() {
        initComponents();
        // TODO: Read in the already-selected Pilot indexes from the database
        //          and have them selected in the Pilot panel
        // pilotPanel.setSelectedIndices(weightIdx);
        
        // TODO: Read in the already-selected Sailplane indexes from the database
        //          and have them selected in the Sailplane panel
        // sailplanePanel.setSelectedIndices(tensionIdx, weightIdx, velocityIdx);
        
        // TODO: Read in the already-selected Airfield indexes from the database
        //          and have them selected in the Airfield panel
        // airfieldPanel.setSelectedIndices(lengthIdx);
        
        // TODO: Read in the already-selected display indexes from the datbase
        //          and have them selected in the display panel
        // displayPanel.setSelectedIndices(lengthIdx, tensionIdx, weightIdx,
        //                                  velocityIdx, tempIdx, pressureIdx);
    }

    /**
     * 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() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        pilotPanel = new unitselection.PilotUnitsPanel();
        sailplanePanel = new unitselection.SailplaneUnitsPanel();
        airfieldPanel = new unitselection.AirfieldUnitsPanel();
        displayPanel = new unitselection.DisplayUnitsPanel();
        jLabel1 = new javax.swing.JLabel();
        submitButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jTabbedPane1.addTab("Pilot", pilotPanel);
        jTabbedPane1.addTab("Sailplane", sailplanePanel);
        jTabbedPane1.addTab("Airfield/Runway/Position", airfieldPanel);
        jTabbedPane1.addTab("Display", displayPanel);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel1.setText("Unit Selection");

        submitButton.setText("Submit Changes");
        submitButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                submitButtonMouseClicked(evt);
            }
        });

        cancelButton.setText("Cancel");
        cancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                cancelButtonMouseEntered(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(138, 138, 138)
                .addComponent(jLabel1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(submitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(9, 9, 9)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(submitButton)
                    .addComponent(cancelButton))
                .addContainerGap(12, Short.MAX_VALUE))
        );

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

    private void submitButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_submitButtonMouseClicked
        // TODO: send pilotPanel.getSelectedIndices() to the database
        // TODO: send sailplanePanel.getSelectedIndices() to the database
        // TODO: send airfieldPanel.getSelectedIndices() to the database
        // TODO: send displayPanel.getSelectedIndices() to the database
        this.dispose();
    }//GEN-LAST:event_submitButtonMouseClicked

    private void cancelButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelButtonMouseEntered
        this.dispose();
    }//GEN-LAST:event_cancelButtonMouseEntered

    /**
     * @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(UnitSelectionFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(UnitSelectionFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(UnitSelectionFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(UnitSelectionFrame.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 UnitSelectionFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private unitselection.AirfieldUnitsPanel airfieldPanel;
    private javax.swing.JButton cancelButton;
    private unitselection.DisplayUnitsPanel displayPanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private unitselection.PilotUnitsPanel pilotPanel;
    private unitselection.SailplaneUnitsPanel sailplanePanel;
    private javax.swing.JButton submitButton;
    // End of variables declaration//GEN-END:variables
}

@@ -101,25 +101,25 @@
 package 
-unitselec
+Configura
 tion;%0A%0A/

Update UnitSelectionFrame.java