diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
index 4abce43..f124f4f 100644
--- a/nbproject/build-impl.xml
+++ b/nbproject/build-impl.xml
@@ -1,1419 +1,1420 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set src.dir
- Must set test.src.dir
- Must set build.dir
- Must set dist.dir
- Must set build.classes.dir
- Must set dist.javadoc.dir
- Must set build.test.classes.dir
- Must set build.test.results.dir
- Must set build.classes.excludes
- Must set dist.jar
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- To run this application from the command line without Ant, try:
-
- java -jar "${dist.jar.resolved}"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must set fix.includes
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set profile.class
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Some tests failed; see details above.
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
- Some tests failed; see details above.
-
-
-
- Must select some files in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
- Some tests failed; see details above.
-
-
-
-
- Must select one file in the IDE or set test.class
-
-
-
- Must select one file in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set profile.class
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+ Must select some files in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+ Must select one file in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
index cb2d623..8121f30 100644
--- a/nbproject/genfiles.properties
+++ b/nbproject/genfiles.properties
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=6d39ee20
-build.xml.script.CRC32=528642be
-build.xml.stylesheet.CRC32=8064a381@1.75.1.48
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=6d39ee20
-nbproject/build-impl.xml.script.CRC32=681df6e3
-nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
+build.xml.data.CRC32=6d39ee20
+build.xml.script.CRC32=528642be
+build.xml.stylesheet.CRC32=8064a381@1.75.1.48
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=6d39ee20
+nbproject/build-impl.xml.script.CRC32=5c486f47
+nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
index 1b6c36a..011fcbd 100644
--- a/nbproject/private/private.properties
+++ b/nbproject/private/private.properties
@@ -1,2 +1,2 @@
-compile.on.save=true
-user.properties.file=C:\\Users\\ANDITYAARIFIANTO\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
+compile.on.save=true
+user.properties.file=C:\\Users\\Geb\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
diff --git a/src/ChatGUI/ChatView.form b/src/ChatGUI/ChatView.form
new file mode 100644
index 0000000..0e90112
--- /dev/null
+++ b/src/ChatGUI/ChatView.form
@@ -0,0 +1,72 @@
+
+
+
diff --git a/src/ChatGUI/ChatView.java b/src/ChatGUI/ChatView.java
new file mode 100644
index 0000000..c536883
--- /dev/null
+++ b/src/ChatGUI/ChatView.java
@@ -0,0 +1,134 @@
+package ChatGUI;
+
+import java.awt.event.ActionListener;
+
+/**
+ *
+ * @author Geb
+ */
+public class ChatView extends javax.swing.JFrame {
+
+ /**
+ * Creates new form JFrameChatView
+ */
+ public ChatView() {
+ 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")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jScrollPane1 = new javax.swing.JScrollPane();
+ txAreaChat = new javax.swing.JTextArea();
+ txFieldChat = new javax.swing.JTextField();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ txAreaChat.setEditable(false);
+ txAreaChat.setColumns(20);
+ txAreaChat.setRows(5);
+ txAreaChat.setText("Input Server IP Address :");
+ jScrollPane1.setViewportView(txAreaChat);
+
+ txFieldChat.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ txFieldChatActionPerformed(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()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(txFieldChat, javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(16, 16, 16)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(txFieldChat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void txFieldChatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txFieldChatActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_txFieldChatActionPerformed
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* 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(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+ //
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new ChatView().setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextArea txAreaChat;
+ private javax.swing.JTextField txFieldChat;
+ // End of variables declaration//GEN-END:variables
+
+ public void setTxAreaChat(String message) {
+ txAreaChat.append(message + "\n");
+ }
+
+ public Object getTxFieldChat() {
+ return txFieldChat;
+ }
+
+ public String getStringChat() {
+ return txFieldChat.getText();
+ }
+
+ public void setTxFieldChat(String message) {
+ this.txFieldChat.setText(message);
+ }
+
+ public void addListener(ActionListener e) {
+ txFieldChat.addActionListener(e);
+ }
+}
diff --git a/src/ChatGUI/JChatController.java b/src/ChatGUI/JChatController.java
new file mode 100644
index 0000000..35981b8
--- /dev/null
+++ b/src/ChatGUI/JChatController.java
@@ -0,0 +1,63 @@
+package ChatGUI;
+
+import ChatGUI.ChatView;
+import ChatGUI.ChatView;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javaChat.ClientConnection;
+import java.io.IOException;
+import javax.swing.text.View;
+
+/**
+ *
+ * @author Geb
+ */
+public class JChatController implements ActionListener{
+
+ private ChatView view;
+ private ClientConnection client;
+
+ public JChatController() {
+ view = new ChatView();
+ view.setVisible(true);
+ view.addListener(this);
+ client = null;
+ }
+
+ public class WriteOutput extends Thread{
+
+ public void run(){
+ String inputan;
+ try {
+ while((inputan = client.readStream()) != null){
+ view.setTxAreaChat(inputan);
+ }
+ } catch (Exception e) {
+ System.out.println("Error");
+ }
+ }
+ }
+
+ public void actionPerformed(ActionEvent ae){
+
+ Object source = ae.getSource();
+
+ if (source.equals(view.getTxFieldChat())){
+ if (client == null){
+ try {
+ client = new ClientConnection();
+ String ip = view.getStringChat();
+ client.connect(ip);
+ WriteOutput w = new WriteOutput();
+ w.start();
+ } catch (Exception e) {
+ System.out.println("Error");
+ }
+ }else{
+ String input = view.getStringChat();
+ client.writeStream(input);
+ view.setTxFieldChat("");
+ }
+ }
+ }
+}
diff --git a/src/Driver/DriverClientConsole.java b/src/Driver/DriverClientConsole.java
new file mode 100644
index 0000000..c5aef3f
--- /dev/null
+++ b/src/Driver/DriverClientConsole.java
@@ -0,0 +1,21 @@
+package Driver;
+
+import consoleApp.ConsoleApplication;
+
+/*
+ * 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.
+ */
+
+/**
+ *
+ * @author Geb
+ */
+public class DriverClientConsole {
+ public static void main(String[] args) {
+
+ ConsoleApplication ca = new ConsoleApplication();
+ ca.startChat();
+ }
+}
diff --git a/src/Driver/DriverClientGUI.java b/src/Driver/DriverClientGUI.java
new file mode 100644
index 0000000..2c59604
--- /dev/null
+++ b/src/Driver/DriverClientGUI.java
@@ -0,0 +1,20 @@
+package Driver;
+
+import ChatGUI.JChatController;
+
+/*
+ * 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.
+ */
+
+/**
+ *
+ * @author Geb
+ */
+public class DriverClientGUI {
+ public static void main(String[] args) {
+
+ JChatController jcc = new JChatController();
+ }
+}
diff --git a/src/Driver/DriverServer.java b/src/Driver/DriverServer.java
new file mode 100644
index 0000000..b67bcad
--- /dev/null
+++ b/src/Driver/DriverServer.java
@@ -0,0 +1,30 @@
+/*
+ * 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 Driver;
+
+import consoleApp.ConnectionThread;
+import javaChat.ServerConnection;
+
+/**
+ *
+ * @author Geb
+ */
+public class DriverServer {
+ public static void main(String[] args) {
+
+ try {
+ ServerConnection server = new ServerConnection();
+ System.out.println("Server Information");
+ System.out.println(server.getServerInformation());
+ while (true) {
+ ConnectionThread connection = new ConnectionThread(server.getClient());
+ connection.start();
+ }
+ } catch (Exception e) {
+ System.out.println("Error");
+ }
+ }
+}
diff --git a/src/consoleApp/ConnectionThread.java b/src/consoleApp/ConnectionThread.java
new file mode 100644
index 0000000..39dc281
--- /dev/null
+++ b/src/consoleApp/ConnectionThread.java
@@ -0,0 +1,49 @@
+/*
+ * 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 consoleApp;
+
+import java.io.IOException;
+import java.net.Socket;
+import javaChat.Connection;
+
+/**
+ *
+ * @author Geb
+ */
+public class ConnectionThread extends Thread{
+ private Socket client;
+ private Connection connection;
+
+ public ConnectionThread(Socket newClient) throws IOException{
+ this.client = newClient;
+ connection = new Connection(client);
+ }
+
+ public void run(){
+ try {
+ connection.startChat(" Start The Chat ");
+ System.out.println(" ------------- ");
+ System.out.println(" new cilent connected ");
+ System.out.println(" client information ");
+ System.out.println(connection.getClientInformation());
+
+ String inputan;
+ String message;
+ while((inputan = connection.readStream()) != null && inputan.equals("Quit")){
+ message = "Client " + connection.getIpClient() + "Said : " + inputan;
+ System.out.println(message);
+ connection.sendToAll(message);
+ }
+
+ message = "Client from IP : " + connection.getIpClient() + "Quit the chat room";
+ System.out.println(message);
+ connection.sendToAll(message);
+ connection.disconnect();
+ } catch (Exception e) {
+ System.out.println("Error");
+ }
+ }
+}
diff --git a/src/consoleApp/ConsoleApplication.java b/src/consoleApp/ConsoleApplication.java
new file mode 100644
index 0000000..a11c03f
--- /dev/null
+++ b/src/consoleApp/ConsoleApplication.java
@@ -0,0 +1,66 @@
+/*
+ * 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 consoleApp;
+
+import javaChat.ClientConnection;
+
+/**
+ *
+ * @author Geb
+ */
+public class ConsoleApplication {
+
+ private ClientConnection client;
+
+ public class ReadInput extends Thread{
+
+ public void run(){
+
+ try {
+ String inputKeyboard;
+ do {
+ System.out.println(">> ");
+ inputKeyboard = client.inputString();
+ client.writeStream(inputKeyboard);
+ } while(!inputKeyboard.equals("Quit"));
+ client.disconnect();
+ } catch (Exception e) {
+ System.out.println("Error");
+ }
+ }
+ }
+
+ public class WriteInput extends Thread{
+
+ public void run(){
+
+ try {
+ String inputan;
+ while ((inputan = client.readStream()) != null){
+ System.out.println(inputan);
+ System.out.println(">>");
+ }
+ } catch (Exception e) {
+ System.out.println("Error");
+ }
+ }
+ }
+
+ public void startChat(){
+ try {
+ client = new ClientConnection();
+ System.out.println("Input server IP : ");
+ String ip = client.inputString();
+ client.connect(ip);
+ ReadInput in = new ReadInput();
+ WriteInput out = new WriteInput();
+ in.start();
+ out.start();
+ } catch (Exception e) {
+ System.out.println("Error");
+ }
+ }
+}
diff --git a/src/javaChat/ClientConnection.java b/src/javaChat/ClientConnection.java
index e79488e..d803ae3 100644
--- a/src/javaChat/ClientConnection.java
+++ b/src/javaChat/ClientConnection.java
@@ -13,7 +13,7 @@
/**
*
- * @author dee
+ * @author Geb
*/
public class ClientConnection {
diff --git a/src/javaChat/Connection.java b/src/javaChat/Connection.java
index b049aaa..ab2a61b 100644
--- a/src/javaChat/Connection.java
+++ b/src/javaChat/Connection.java
@@ -17,7 +17,7 @@
/**
*
- * @author dee
+ * @author Geb
*/
public class Connection {
diff --git a/src/javaChat/ServerConnection.java b/src/javaChat/ServerConnection.java
index 8a1902e..4a7b216 100644
--- a/src/javaChat/ServerConnection.java
+++ b/src/javaChat/ServerConnection.java
@@ -12,7 +12,7 @@
/**
*
- * @author dee
+ * @author Geb
*/
public class ServerConnection {