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

/*
 * IT.java
 *
 * Created on 14.Haz.2009, 18:52:01
 */

package desktop;
import java.io.*;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.sql.Time;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;



/**
 *
 * @author casper
 */
public class IT extends javax.swing.JFrame {

    /** Creates new form IT */
    public IT(java.awt.Frame parent) {
        initComponents();
    }

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

        jFrame1 = new javax.swing.JFrame();
        textArea1 = new java.awt.TextArea();
        clear = new java.awt.Button();
        Add = new java.awt.Button();
        textField1 = new java.awt.TextField();
        textField2 = new java.awt.TextField();
        jFrame2 = new javax.swing.JFrame();
        jComboBox1 = new javax.swing.JComboBox();
        textArea2 = new java.awt.TextArea();
        Clear = new java.awt.Button();
        button2 = new java.awt.Button();
        jComboBox2 = new javax.swing.JComboBox();
        request = new javax.swing.JTabbedPane();
        ruleRequest = new javax.swing.JPanel();
        addNewRule = new java.awt.Button();
        modifyExistingRule = new java.awt.Button();
        jScrollPane1 = new javax.swing.JScrollPane();
        allRequests = new javax.swing.JTextArea();
        requestsLabel = new java.awt.Label();
        FactRequest = new javax.swing.JPanel();
        addNewFact = new java.awt.Button();
        modifyExistingFact = new java.awt.Button();
        textArea3 = new java.awt.TextArea();
        button1 = new java.awt.Button();
        button3 = new java.awt.Button();

        jFrame1.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(desktop.DesktopApp.class).getContext().getResourceMap(IT.class);
        jFrame1.setTitle(resourceMap.getString("jFrame1.title")); // NOI18N
        jFrame1.setName("jFrame1"); // NOI18N

        textArea1.setFont(resourceMap.getFont("writeRule.font")); // NOI18N
        textArea1.setName("writeRule"); // NOI18N
        textArea1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                textArea1MouseClicked(evt);
            }
        });

        clear.setLabel(resourceMap.getString("clear.label")); // NOI18N
        clear.setName("clear"); // NOI18N
        clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearActionPerformed(evt);
            }
        });

        Add.setLabel(resourceMap.getString("sendRequest.label")); // NOI18N
        Add.setName("sendRequest"); // NOI18N
        Add.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddActionPerformed(evt);
            }
        });

        textField1.setName("ruleName"); // NOI18N
        textField1.setText(resourceMap.getString("ruleName.text")); // NOI18N
        textField1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                textField1MouseClicked(evt);
            }
        });

        textField2.setName("rulesetName"); // NOI18N
        textField2.setText(resourceMap.getString("rulesetName.text")); // NOI18N
        textField2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                textField2MouseClicked(evt);
            }
        });
        textField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textField2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
        jFrame1.getContentPane().setLayout(jFrame1Layout);
        jFrame1Layout.setHorizontalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrame1Layout.createSequentialGroup()
                .addContainerGap(24, Short.MAX_VALUE)
                .addGroup(jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jFrame1Layout.createSequentialGroup()
                        .addComponent(textField2, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textField1, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jFrame1Layout.createSequentialGroup()
                            .addComponent(clear, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(35, 35, 35)
                            .addComponent(Add, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(textArea1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 341, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(35, Short.MAX_VALUE))
        );
        jFrame1Layout.setVerticalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrame1Layout.createSequentialGroup()
                .addContainerGap(20, Short.MAX_VALUE)
                .addGroup(jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(textField2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(textField1, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addGroup(jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(clear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Add, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(52, Short.MAX_VALUE))
        );

        jFrame2.setName("jFrame2"); // NOI18N

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select Ruleset" }));
        jComboBox1.setName("jComboBox1"); // NOI18N

        textArea2.setFont(resourceMap.getFont("textArea2.font")); // NOI18N
        textArea2.setName("textArea2"); // NOI18N

        Clear.setLabel(resourceMap.getString("clear.label")); // NOI18N
        Clear.setName("clear"); // NOI18N
        Clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ClearActionPerformed(evt);
            }
        });

        button2.setLabel(resourceMap.getString("send.label")); // NOI18N
        button2.setName("send"); // NOI18N

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select Rule" }));
        jComboBox2.setName("jComboBox2"); // NOI18N

        javax.swing.GroupLayout jFrame2Layout = new javax.swing.GroupLayout(jFrame2.getContentPane());
        jFrame2.getContentPane().setLayout(jFrame2Layout);
        jFrame2Layout.setHorizontalGroup(
            jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrame2Layout.createSequentialGroup()
                .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jFrame2Layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textArea2, javax.swing.GroupLayout.PREFERRED_SIZE, 336, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jFrame2Layout.createSequentialGroup()
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(84, 84, 84)
                                .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jFrame2Layout.createSequentialGroup()
                        .addGap(163, 163, 163)
                        .addComponent(Clear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(19, 19, 19)
                        .addComponent(button2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        jFrame2Layout.setVerticalGroup(
            jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrame2Layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(35, 35, 35)
                .addComponent(textArea2, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31)
                .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Clear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(107, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setAlwaysOnTop(true);
        setFocusableWindowState(false);
        setIconImages(null);
        setName("Form"); // NOI18N

        request.setBackground(resourceMap.getColor("request.background")); // NOI18N
        request.setBorder(javax.swing.BorderFactory.createCompoundBorder());
        request.setForeground(resourceMap.getColor("request.foreground")); // NOI18N
        request.setFont(resourceMap.getFont("request.font")); // NOI18N

        ruleRequest.setName("ruleRequest"); // NOI18N

        addNewRule.setBackground(resourceMap.getColor("addNewRule.background")); // NOI18N
        addNewRule.setFont(resourceMap.getFont("addNewRule.font")); // NOI18N
        addNewRule.setForeground(resourceMap.getColor("addNewRule.foreground")); // NOI18N
        addNewRule.setLabel(resourceMap.getString("addNewRule.label")); // NOI18N
        addNewRule.setName("addNewRule"); // NOI18N
        addNewRule.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addNewRuleActionPerformed(evt);
            }
        });

        modifyExistingRule.setBackground(resourceMap.getColor("modifyRule.background")); // NOI18N
        modifyExistingRule.setFont(resourceMap.getFont("modifyRule.font")); // NOI18N
        modifyExistingRule.setForeground(resourceMap.getColor("modifyRule.foreground")); // NOI18N
        modifyExistingRule.setLabel(resourceMap.getString("modifyRule.label")); // NOI18N
        modifyExistingRule.setName("modifyRule"); // NOI18N
        modifyExistingRule.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                modifyExistingRuleMouseReleased(evt);
            }
        });

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        allRequests.setColumns(20);
        allRequests.setFont(resourceMap.getFont("allRequests.font")); // NOI18N
        allRequests.setRows(5);
        allRequests.setName("allRequests"); // NOI18N
        jScrollPane1.setViewportView(allRequests);

        requestsLabel.setFont(resourceMap.getFont("requestsLabel.font")); // NOI18N
        requestsLabel.setForeground(resourceMap.getColor("requestsLabel.foreground")); // NOI18N
        requestsLabel.setName("requestsLabel"); // NOI18N
        requestsLabel.setText(resourceMap.getString("requestsLabel.text")); // NOI18N

        javax.swing.GroupLayout ruleRequestLayout = new javax.swing.GroupLayout(ruleRequest);
        ruleRequest.setLayout(ruleRequestLayout);
        ruleRequestLayout.setHorizontalGroup(
            ruleRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ruleRequestLayout.createSequentialGroup()
                .addGap(47, 47, 47)
                .addComponent(addNewRule, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 97, Short.MAX_VALUE)
                .addComponent(modifyExistingRule, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(55, 55, 55))
            .addGroup(ruleRequestLayout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(ruleRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ruleRequestLayout.createSequentialGroup()
                        .addComponent(requestsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(ruleRequestLayout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
                        .addGap(35, 35, 35))))
        );
        ruleRequestLayout.setVerticalGroup(
            ruleRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ruleRequestLayout.createSequentialGroup()
                .addGap(44, 44, 44)
                .addGroup(ruleRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(modifyExistingRule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(addNewRule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(requestsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(109, 109, 109))
        );

        request.addTab(resourceMap.getString("ruleRequest.TabConstraints.tabTitle"), ruleRequest); // NOI18N

        FactRequest.setName("FactRequest"); // NOI18N

        addNewFact.setBackground(resourceMap.getColor("newFact.background")); // NOI18N
        addNewFact.setFont(resourceMap.getFont("newFact.font")); // NOI18N
        addNewFact.setForeground(resourceMap.getColor("newFact.foreground")); // NOI18N
        addNewFact.setLabel(resourceMap.getString("newFact.label")); // NOI18N
        addNewFact.setName("newFact"); // NOI18N
        addNewFact.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addNewFactActionPerformed(evt);
            }
        });

        modifyExistingFact.setBackground(resourceMap.getColor("modifyFact.background")); // NOI18N
        modifyExistingFact.setFont(resourceMap.getFont("modifyFact.font")); // NOI18N
        modifyExistingFact.setForeground(resourceMap.getColor("modifyFact.foreground")); // NOI18N
        modifyExistingFact.setLabel(resourceMap.getString("modifyFact.label")); // NOI18N
        modifyExistingFact.setName("modifyFact"); // NOI18N

        textArea3.setName("textArea3"); // NOI18N

        button1.setLabel(resourceMap.getString("clear.label")); // NOI18N
        button1.setName("clear"); // NOI18N

        button3.setLabel(resourceMap.getString("send.label")); // NOI18N
        button3.setName("send"); // NOI18N

        javax.swing.GroupLayout FactRequestLayout = new javax.swing.GroupLayout(FactRequest);
        FactRequest.setLayout(FactRequestLayout);
        FactRequestLayout.setHorizontalGroup(
            FactRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(FactRequestLayout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(FactRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(FactRequestLayout.createSequentialGroup()
                        .addComponent(addNewFact, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(78, 78, 78)
                        .addComponent(modifyExistingFact, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(FactRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(button3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(textArea3, javax.swing.GroupLayout.PREFERRED_SIZE, 386, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(81, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, FactRequestLayout.createSequentialGroup()
                .addContainerGap(221, Short.MAX_VALUE)
                .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(230, 230, 230))
        );
        FactRequestLayout.setVerticalGroup(
            FactRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(FactRequestLayout.createSequentialGroup()
                .addGap(50, 50, 50)
                .addGroup(FactRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(modifyExistingFact, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(addNewFact, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(30, 30, 30)
                .addComponent(textArea3, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(44, 44, 44)
                .addGroup(FactRequestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(button3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(72, Short.MAX_VALUE))
        );

        request.addTab(resourceMap.getString("FactRequest.TabConstraints.tabTitle"), FactRequest); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(request, javax.swing.GroupLayout.DEFAULT_SIZE, 502, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(request, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
        );

        request.getAccessibleContext().setAccessibleName(resourceMap.getString("factRequest.AccessibleContext.accessibleName")); // NOI18N

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

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

    private void addNewRuleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addNewRuleActionPerformed
        // TODO add your handling code here:

        this.textField1.setFont(new java.awt.Font("Dialog",2,12));
        this.textField1.setForeground(new java.awt.Color(120, 120, 120));
        this.textField1.setText("Rule Name...");

        this.textField2.setFont(new java.awt.Font("Dialog",2,12));
        this.textField2.setForeground(new java.awt.Color(120, 120, 120));
        this.textField2.setText("Ruleset Name...");

        this.textArea1.setFont(new java.awt.Font("Dialog",2,14));
        this.textArea1.setForeground(new java.awt.Color(120, 120, 120));
        this.textArea1.setText("Please write you rule here...");
        jFrame1.show();
        jFrame1.setSize(500, 300);
   
}//GEN-LAST:event_addNewRuleActionPerformed

    private void clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearActionPerformed
        // TODO add your handling code here:
        this.textField1.setFont(new java.awt.Font("Dialog",2,12));
        this.textField1.setForeground(new java.awt.Color(120, 120, 120));
        this.textField1.setText("Rule Name...");

        this.textField2.setFont(new java.awt.Font("Dialog",2,12));
        this.textField2.setForeground(new java.awt.Color(120, 120, 120));
        this.textField2.setText("Ruleset Name...");

        this.textArea1.setFont(new java.awt.Font("Dialog",2,14));
        this.textArea1.setForeground(new java.awt.Color(120, 120, 120));
        this.textArea1.setText("Please write your rule here...");
    }//GEN-LAST:event_clearActionPerformed

    private void AddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddActionPerformed
        // TODO add your handling code here:
        if (this.textArea1.getText().equals( "Please write your rule here...") || (this.textField1.getText().equals("Rule Name...")) || (this.textField2.getText().equals("Ruleset Name..."))  )
        ;
        else
        {
          ruleName=this.textField1.getText();
          rulesetName=this.textField2.getText();
          System.out.println(ruleName);
          System.out.println(rulesetName);

         ruleReq=this.textArea1.getText();
         System.out.println(ruleReq);
         //Date.getTime();
         this.allRequests.setText(this.allRequests.getText()+ count +". "+"Ruleset Name: "+rulesetName+"  Rule Name: "+ruleName+"."+"  Rule: "+ ruleReq+'\n');

         this.textField1.setFont(new java.awt.Font("Dialog",2,12));
        this.textField1.setForeground(new java.awt.Color(120, 120, 120));
        this.textField1.setText("Rule Name...");

        this.textField2.setFont(new java.awt.Font("Dialog",2,12));
        this.textField2.setForeground(new java.awt.Color(120, 120, 120));
        this.textField2.setText("Ruleset Name...");

        this.textArea1.setFont(new java.awt.Font("Dialog",2,14));
        this.textArea1.setForeground(new java.awt.Color(120, 120, 120));
        this.textArea1.setText("Please write your rule here...");

        count++;

        try {
        BufferedWriter out = new BufferedWriter(new FileWriter("outfilename"));
        out.write(this.allRequests.getText());
        out.close();
    } catch (IOException e) {
    }

        }
            //add to RuleRequests in Requests Database
    }//GEN-LAST:event_AddActionPerformed

    private void textField1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_textField1MouseClicked
        // TODO add your handling code here:
        this.textField1.setText("");
        this.textField1.setFont(new java.awt.Font("Dialog",1,12));
        this.textField1.setForeground(new java.awt.Color(0, 0, 0));
    }//GEN-LAST:event_textField1MouseClicked

    private void textArea1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_textArea1MouseClicked
        // TODO add your handling code here:
        this.textArea1.setText("");
        this.textArea1.setFont(new java.awt.Font("Dialog",1,14));
        this.textArea1.setForeground(new java.awt.Color(0, 0, 0));
    }//GEN-LAST:event_textArea1MouseClicked

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

    private void modifyExistingRuleMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_modifyExistingRuleMouseReleased
        // TODO add your handling code here:
        jFrame2.show();
        jFrame2.setSize(500, 300);

    }//GEN-LAST:event_modifyExistingRuleMouseReleased

    private void textField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textField2ActionPerformed
        // TODO add your handling code here:
        this.textField2.setText("");
        this.textField2.setFont(new java.awt.Font("Dialog",1,12));
        this.textField2.setForeground(new java.awt.Color(0, 0, 0));
    }//GEN-LAST:event_textField2ActionPerformed

    private void textField2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_textField2MouseClicked
        // TODO add your handling code here:
        this.textField2.setText("");
        this.textField2.setFont(new java.awt.Font("Dialog",1,12));
        this.textField2.setForeground(new java.awt.Color(0, 0, 0));
    }//GEN-LAST:event_textField2MouseClicked

    /**
    * @param args the command line arguments
    */
    public File requestLog;
    private Time time;
    private int count=1;
    private String ruleReq,ruleName,rulesetName;
    private String factReq,factName;

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Button Add;
    private java.awt.Button Clear;
    private javax.swing.JPanel FactRequest;
    private java.awt.Button addNewFact;
    private java.awt.Button addNewRule;
    private javax.swing.JTextArea allRequests;
    private java.awt.Button button1;
    private java.awt.Button button2;
    private java.awt.Button button3;
    private java.awt.Button clear;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JFrame jFrame1;
    private javax.swing.JFrame jFrame2;
    private javax.swing.JScrollPane jScrollPane1;
    private java.awt.Button modifyExistingFact;
    private java.awt.Button modifyExistingRule;
    private javax.swing.JTabbedPane request;
    private java.awt.Label requestsLabel;
    private javax.swing.JPanel ruleRequest;
    private java.awt.TextArea textArea1;
    private java.awt.TextArea textArea2;
    private java.awt.TextArea textArea3;
    private java.awt.TextField textField1;
    private java.awt.TextField textField2;
    // End of variables declaration//GEN-END:variables

}
