Merge branch 'feature_client'
[WeStealzYourDataz.git] / src / uk / ac / ntu / n0521366 / wsyd / client / Chat.java
diff --git a/src/uk/ac/ntu/n0521366/wsyd/client/Chat.java b/src/uk/ac/ntu/n0521366/wsyd/client/Chat.java
new file mode 100644 (file)
index 0000000..55e699b
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * 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 uk.ac.ntu.n0521366.wsyd.client;
+
+/**
+ *
+ * @author Eddie Berrisford-Lynch
+ */
+public class Chat extends javax.swing.JDialog {
+
+    /**
+     * Creates new form WSYD_Chat
+     */
+    public Chat(java.awt.Frame parent, boolean modal) {
+        super(parent, modal);
+        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() {
+        java.awt.GridBagConstraints gridBagConstraints;
+
+        gPanelChatInstance = new javax.swing.JPanel();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        gListChatWindow = new javax.swing.JList();
+        jPanel2 = new javax.swing.JPanel();
+        gButtonAttach = new javax.swing.JButton();
+        jScrollPane2 = new javax.swing.JScrollPane();
+        gTAreaMessage = new javax.swing.JTextArea();
+        gButtonSend = new javax.swing.JButton();
+        gTPanelNewChat = new javax.swing.JTabbedPane();
+
+        gPanelChatInstance.setMinimumSize(new java.awt.Dimension(450, 350));
+        gPanelChatInstance.setPreferredSize(new java.awt.Dimension(450, 350));
+        gPanelChatInstance.setLayout(new java.awt.BorderLayout());
+
+        gListChatWindow.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
+        gListChatWindow.setModel(new javax.swing.AbstractListModel() {
+            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
+            public int getSize() { return strings.length; }
+            public Object getElementAt(int i) { return strings[i]; }
+        });
+        gListChatWindow.setPreferredSize(new java.awt.Dimension(300, 180));
+        gListChatWindow.setVisibleRowCount(20);
+        jScrollPane1.setViewportView(gListChatWindow);
+
+        gPanelChatInstance.add(jScrollPane1, java.awt.BorderLayout.CENTER);
+
+        jPanel2.setPreferredSize(new java.awt.Dimension(450, 70));
+        jPanel2.setLayout(new java.awt.GridBagLayout());
+
+        gButtonAttach.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N
+        gButtonAttach.setText("Attach");
+        gButtonAttach.setPreferredSize(new java.awt.Dimension(94, 50));
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
+        jPanel2.add(gButtonAttach, gridBagConstraints);
+
+        jScrollPane2.setMinimumSize(new java.awt.Dimension(256, 100));
+
+        gTAreaMessage.setColumns(20);
+        gTAreaMessage.setRows(6);
+        jScrollPane2.setViewportView(gTAreaMessage);
+
+        jPanel2.add(jScrollPane2, new java.awt.GridBagConstraints());
+
+        gButtonSend.setText("Send");
+        gButtonSend.setPreferredSize(new java.awt.Dimension(94, 50));
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
+        jPanel2.add(gButtonSend, gridBagConstraints);
+
+        gPanelChatInstance.add(jPanel2, java.awt.BorderLayout.PAGE_END);
+
+        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+        gTPanelNewChat.setMinimumSize(new java.awt.Dimension(450, 350));
+        gTPanelNewChat.setPreferredSize(new java.awt.Dimension(500, 400));
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(gTPanelNewChat, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(gTPanelNewChat, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)
+        );
+
+        pack();
+    }// </editor-fold>//GEN-END:initComponents
+
+    /**
+     * @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(Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (InstantiationException ex) {
+            java.util.logging.Logger.getLogger(Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (IllegalAccessException ex) {
+            java.util.logging.Logger.getLogger(Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+            java.util.logging.Logger.getLogger(Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        }
+        //</editor-fold>
+        //</editor-fold>
+
+        /* Create and display the dialog */
+        java.awt.EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                Chat dialog = new Chat(new javax.swing.JFrame(), true);
+                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
+                    @Override
+                    public void windowClosing(java.awt.event.WindowEvent e) {
+                        System.exit(0);
+                    }
+                });
+                dialog.setVisible(true);
+            }
+        });
+    }
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton gButtonAttach;
+    private javax.swing.JButton gButtonSend;
+    private javax.swing.JList gListChatWindow;
+    private javax.swing.JPanel gPanelChatInstance;
+    private javax.swing.JTextArea gTAreaMessage;
+    private javax.swing.JTabbedPane gTPanelNewChat;
+    private javax.swing.JPanel jPanel2;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JScrollPane jScrollPane2;
+    // End of variables declaration//GEN-END:variables
+}