/*
 * Email_n.java
 *
 * Created on November 18, 2003, 4:25 PM
 */

package usda.weru.erosion.gui;
/**
 * This GUI helps the user to attach the project and the specific run along with 
 * some commentsto send any errors or exceptions that occured to the WEPS support 
 * team or other people by mentioning their email address from within the application. 
 * @author  manmohan
 */
public class Email_n extends javax.swing.JFrame {
    private static final long serialVersionUID = 1L;
    
    /** Creates new form Email_n */
    /**
    * Default constructor for the Email GUI object that helps the user in sending 
    * the email with bug reports attached if the application doen't execute properly 
    * to the WEPS support tem.
    */
    public Email_n() {
        initComponents();
//        //System.out.println("Email_n: Default constructor");
    }
    
      /**
    * Default constructor for the Email GUI object that helps the user in sending 
    * the email with bug reports attached if the application doen't execute properly 
    * to the WEPS support tem.
    * @param sTitle The frame title in which the email details will be fed for sending 
     * bug reports  or other quesries.
    */
    public Email_n(java.lang.String sTitle) {
        this();
        setTitle(sTitle);
//        //System.out.println("Email_n: 1 argument constructor");
    }
    
 
    
    
    /** 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.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JP_main = new javax.swing.JPanel();
        JSP_text = new javax.swing.JScrollPane();
        JTA_text = new javax.swing.JTextArea();
        JP_buttons = new javax.swing.JPanel();
        JB_send = new javax.swing.JButton();
        JB_cancel = new javax.swing.JButton();
        JB_Run = new javax.swing.JButton();
        JLabel1 = new javax.swing.JLabel();
        JLabel2 = new javax.swing.JLabel();
        JLabel3 = new javax.swing.JLabel();
        JLabel4 = new javax.swing.JLabel();
        JTF_from = new javax.swing.JTextField();
        JTF_subject = new javax.swing.JTextField();
        JTF_attachment = new javax.swing.JTextField();
        JL_header = new javax.swing.JLabel();
        JCB_to = new javax.swing.JComboBox<Object>();

        setTitle("sTitle");
        setMaximizedBounds(new java.awt.Rectangle(0, 0, 600, 400));
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
            }
        });
        getContentPane().setLayout(null);

        JP_main.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JP_main.setLayout(null);

        JSP_text.setViewportBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JSP_text.setPreferredSize(new java.awt.Dimension(5, 21));
        JSP_text.setViewportView(JTA_text);

        JP_main.add(JSP_text);
        JSP_text.setBounds(7, 118, 565, 275);

        JB_send.setMnemonic('S');
        JB_send.setText("Send");
        JB_send.setToolTipText("Email:JB_Send");
        JB_send.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBSend_ActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_send);

        JB_cancel.setMnemonic('C');
        JB_cancel.setText("Cancel");
        JB_cancel.setToolTipText("Email:JB_Cancel");
        JB_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBCancel_ActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_cancel);

        JB_Run.setMnemonic('R');
        JB_Run.setText("Attach Run");
        JB_Run.setToolTipText("Email:JB_Run");
        JB_Run.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBRun_ActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_Run);

        JP_main.add(JP_buttons);
        JP_buttons.setBounds(10, 395, 560, 40);

        JLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel1.setText("To :");
        JP_main.add(JLabel1);
        JLabel1.setBounds(10, 25, 75, 19);

        JLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel2.setText("From :");
        JP_main.add(JLabel2);
        JLabel2.setBounds(10, 45, 75, 19);

        JLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel3.setText("Subject :");
        JP_main.add(JLabel3);
        JLabel3.setBounds(10, 65, 75, 19);

        JLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel4.setText("Attachment :");
        JP_main.add(JLabel4);
        JLabel4.setBounds(10, 85, 75, 19);

        JTF_from.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JP_main.add(JTF_from);
        JTF_from.setBounds(90, 45, 250, 19);

        JTF_subject.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JP_main.add(JTF_subject);
        JTF_subject.setBounds(90, 65, 400, 19);

        JTF_attachment.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JP_main.add(JTF_attachment);
        JTF_attachment.setBounds(90, 85, 400, 19);

        JL_header.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        JL_header.setText("E-mail ");
        JP_main.add(JL_header);
        JL_header.setBounds(30, 2, 480, 20);

        JCB_to.setEditable(true);
        JCB_to.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                JCB_toItemStateChanged(evt);
            }
        });
        JCB_to.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JCB_toActionPerformed(evt);
            }
        });
        JCB_to.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JCB_toFocusLost(evt);
            }
        });
        JP_main.add(JCB_to);
        JCB_to.setBounds(90, 25, 250, 19);

        getContentPane().add(JP_main);
        JP_main.setBounds(10, 5, 580, 440);

        getAccessibleContext().setAccessibleName("");

        setSize(new java.awt.Dimension(600, 479));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    protected void JCB_toFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JCB_toFocusLost
    }//GEN-LAST:event_JCB_toFocusLost

    protected void JCB_toActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JCB_toActionPerformed
    }//GEN-LAST:event_JCB_toActionPerformed

    protected void JCB_toItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_JCB_toItemStateChanged
    }//GEN-LAST:event_JCB_toItemStateChanged

    protected void JBRun_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBRun_ActionPerformed
    }//GEN-LAST:event_JBRun_ActionPerformed

    protected void JBCancel_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBCancel_ActionPerformed
    }//GEN-LAST:event_JBCancel_ActionPerformed

    protected void JBSend_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBSend_ActionPerformed
    }//GEN-LAST:event_JBSend_ActionPerformed
    
  
    /** 
    * This method is called when the email frame is to be closed by hitting the 
    * "Red X" button of the window.
    * @param evt The window event generated when the " Red X " button on the window is hit. 
    */
    protected void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
        this.dispose();
    }//GEN-LAST:event_exitForm
    
  /**
   * This method is used if this dialog is rum as an independent application. If executed,
   * makes the GUI visible.
   * @param args These are the command line arguments passed to the main method.
   */
    public static void main(String args[]) {
		javax.swing.JFrame jf = new javax.swing.JFrame("test");
		jf.setVisible(true);
		Email_n e = new Email_n();
		//System.out.println("E_m: " + e);
		e.setVisible(true);
		e.invalidate();
		e.repaint();
		e.setVisible(true);
		//System.out.println("E_m: " + e);
        //System.out.println("Email_n: Inside main after Email_n.setVisible(true)");
    }
        
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton JB_Run;
    public javax.swing.JButton JB_cancel;
    public javax.swing.JButton JB_send;
    public javax.swing.JComboBox<Object> JCB_to;
    public javax.swing.JLabel JL_header;
    public javax.swing.JLabel JLabel1;
    public javax.swing.JLabel JLabel2;
    public javax.swing.JLabel JLabel3;
    public javax.swing.JLabel JLabel4;
    public javax.swing.JPanel JP_buttons;
    public javax.swing.JPanel JP_main;
    public javax.swing.JScrollPane JSP_text;
    public javax.swing.JTextArea JTA_text;
    public javax.swing.JTextField JTF_attachment;
    public javax.swing.JTextField JTF_from;
    public javax.swing.JTextField JTF_subject;
    // End of variables declaration//GEN-END:variables
    
}
