diff --git a/Task_4-master/README.md b/Task_4-master/README.md
new file mode 100644
index 0000000..903fa5c
--- /dev/null
+++ b/Task_4-master/README.md
@@ -0,0 +1,178 @@
+# Task_4 2017
+Exercise on Inner Class and Threading
+
+
+Buatlah program java untuk chatting antar computer sebagai berikut
+
+## Package javaChat
+---
+Package berisi kelas-kelas Socket dan Network Programming
+ [disediakan]
+
+## Package consoleApp
+---
+Package berisi kelas-kelas model
+
+### ConnectionThread.java
+Buatlah class ConnectionThread.java sebagai berikut
+ * extends Thread
+ * import library berikut
+ 
+ * buatlah class sesuai class diagram berikut
+ 
+
+#### Constructor
+ * Constructor throws IOException
+ * Constructor mengeset attribut client dan menginstansiasi objek Connection dengan input client
+ 
+
+#### method run()
+ * Merupakan method yang dijalankan saat thread diaktifkan
+ * Thread akan aktif setiap ada Client baru yang terhubung ke Server
+ * Thread akan berhenti ketika Client mengirimkan pesan "quit"
+ * lakukan proses berikut dalam blok try-catch
+ * jalankan proses chatting dengan memanggil method startChat(String) dari objek connection
+ 
+ * tampilkan informasi Client yang terhubung dengan method getClientInformation dari Objek connection
+ 
+ * lakukan proses loop membaca inputan text dari client dengan memanggil method readStream() dari objek connection selama input readStream masih membaca dan input String bukanlah "quit"
+ * tampilkan pesan yang diterima dari client, dan kirimkan (broadcast) pesat tersebut ke client yang lain menggunakan method sendToAll() dari objek connection
+ 
+ * tampilkan pesan kepada semua client jika ada client yang keluar dari chat room, kemudian putuskan koneksi terhadap client tsb dengan memanggil method disconnect() dari object connection
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+### ConsoleApplication.java
+Buatlah class ConsoleApplication.java sebagai berikut
+ * buatlah class sesuai class diagram berikut
+ 
+ * class ReadInput dan WriteOutput merupakan Inner Class
+
+ #### inner class ReadInput
+ * extends Thread
+ * method run()
+ * lakukan proses berikut dalam blok try-catch
+ * Thread akan membaca input keyboard dari client dengan memanggil method inputString()
+ * Mengirimkan hasil input keyboard ke server melalui method writeStream() selama input dari client bukanlah kata "quit"
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+ #### inner class WriteOutput
+ * extends Thread
+ * method run()
+ * lakukan proses berikut dalam blok try-catch
+ * Thread akan menerima pesan yang dikirimkan dari server melalui method readStream()
+ * Menampilkan ke layar selama pesan dari server masih ada (bukan null)
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+ #### method startChat()
+ * lakukan proses berikut dalam blok try-catch
+ * Instansiasi objek ClientConnection
+ 
+ * Minta input alamat ip Server menggunakan method inputString()
+ * Koneksikan ip client ke server dengan memanggil method connect(ip)
+ 
+ * Instansiasi dan jalankan Thread ReadInput dan WriteInput
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+## Package chatGUI
+ ---
+Package berisi kelas view GUI dan controller
+
+### ChatView.java
+Buatlah class JFrame ChatView.java dengan tampilan sebagai berikut
+ 
+ * terdapat sebuah text area (txAreaChat)
+ * set editable text area = false (uncheck editable)
+ * tambahkan text "Input Server IP Address : " pada text area
+ 
+ * terdapat sebuah text field (txFieldChat)
+ * tambahkan method getTxFieldChat() yang mengembalikan objek text field txFieldChat
+ * tambahkan method getStringChat() yang mengembalikan String dari text field txFieldChat
+ * tambahkan method setTxFieldChat(String) yang mengeset String pada text field txFieldChat
+ * tambahkan method setTxAreaChat(String) yang menambahkan string pada baris baru pada text area txAreaChat
+ 
+ * import java.awt.event.ActionListener;
+ * tambahkan method addListener(ActionListener e)
+ * tambahkan add listener dengan memanggil method addActionListener pada text field txfieldChat
+ 
+
+### ChatController.java
+Buatlah class JChatController.java sebagai berikut
+ * buatlah class sesuai class diagram berikut
+ 
+ * class WriteOutput merupakan Inner Class
+ * import java.awt.event.ActionListener;
+ * kelas implements ActionListener
+ * implementasikan method actionPerformed(ActionEvent ae)
+
+#### Constructor ChatController
+ * Constructor menginstansiasi GUI view
+ * set visible view = true
+ * set lisener view dengan controller this
+ * set client = null
+ 
+
+#### inner class WriteOutput
+ * extends Thread
+ * method run()
+ * lakukan proses berikut dalam blok try-catch
+ * Thread akan menerima pesan yang dikirimkan dari server melalui method readStream()
+ * Menampilkan pesan ke text area view selama pesan dari server masih ada (bukan null) menggunakan method setTxAreaChat
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+#### method actionPerformed(ActionEvent ae)
+ * get Object source action event
+ 
+ * cek source action event
+ * jika event berasal dari text field (tekan tombol enter di text field), cek apakah client sudah terhubung
+ * jika client masih null
+ * lakukan proses berikut dalam blok try-catch
+ * instansiasi ClientConnection baru
+ * Terima string ip dari user dengan memanggil method getStringChat dari objek view
+ 
+ * Instansiasi dan jalankan objek WriteOutput
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+ * jika client sudah terbentuk (koneksi sudah terbentuk)
+ * terima input dari view menggunakan method getStringChat()
+ * kirimkan hasil input String ke server melalui method writeStream()
+ 
+ * hapus isi dari text field pada view menggunakan method setTxFieldChat
+ 
+
+## Package driver
+ ---
+Package berisi kelas-kelas model
+
+### DriverServer.java
+Buatlah class DriverServer.java sebagai berikut
+ * kelas memiliki main method (psvm)
+ * lakukan proses berikut dalam blok try-catch di dalam main method
+ * Instansiasi objek ServerConnection dan tampilkan informasi server dengan memanggil method getServerInformation()
+ 
+ * Lakukan perulangan untuk menjalankan ConnectionThread setiap server menerima Client baru
+ * Jalankan thread connection
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+ * Jalankan kelas DriverServer
+
+### DriverClientConsole.java
+Buatlah class DriverClient.java sebagai berikut
+ * kelas memiliki main method (psvm)
+ * instansiasi objek ConsoleApplication
+ * panggil method startChat dari objek ConsoleApplication
+ * Jalankan kelas DriverClientConsole
+ * hubungkan dengan IP server
+ * cobalah aplikasi chat console yang telah dibuat
+
+### DriverClientGui.java
+Buatlah class DriverClientGui.java sebagai berikut
+ * kelas memiliki main method (psvm)
+ * instansiasi objek ChatController
+ * Jalankan kelas DriverClientGui
+ * hubungkan dengan IP server
+ * cobalah aplikasi chat Gui yang telah dibuat
diff --git a/Task_4-master/Task_4/README.md b/Task_4-master/Task_4/README.md
new file mode 100644
index 0000000..8332320
--- /dev/null
+++ b/Task_4-master/Task_4/README.md
@@ -0,0 +1,178 @@
+# Task_4 2017
+Exercise on Inner Class and Threading
+
+
+Buatlah program java untuk chatting antar computer sebagai berikut
+
+## Package javaChat
+---
+Package berisi kelas-kelas Socket dan Network Programming
+ [disediakan]
+
+## Package consoleApp
+---
+Package berisi kelas-kelas model
+
+### ConnectionThread.java
+Buatlah class ConnectionThread.java sebagai berikut
+ * extends Thread
+ * import library berikut
+ 
+ * buatlah class sesuai class diagram berikut
+ 
+
+#### Constructor
+ * Constructor throws IOException
+ * Constructor mengeset attribut client dan menginstansiasi objek Connection dengan input client
+ 
+
+#### method run()
+ * Merupakan method yang dijalankan saat thread diaktifkan
+ * Thread akan aktif setiap ada Client baru yang terhubung ke Server
+ * Thread akan berhenti ketika Client mengirimkan pesan "quit"
+ * lakukan proses berikut dalam blok try-catch
+ * jalankan proses chatting dengan memanggil method startChat(String) dari objek connection
+ 
+ * tampilkan informasi Client yang terhubung dengan method getClientInformation dari Objek connection
+ 
+ * lakukan proses loop membaca inputan text dari client dengan memanggil method readStream() dari objek connection selama input readStream masih membaca dan input String bukanlah "quit"
+ * tampilkan pesan yang diterima dari client, dan kirimkan (broadcast) pesat tersebut ke client yang lain menggunakan method sendToAll() dari objek connection
+ 
+ * tampilkan pesan kepada semua client jika ada client yang keluar dari chat room, kemudian putuskan koneksi terhadap client tsb dengan memanggil method disconnect() dari object connection
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+### ConsoleApplication.java
+Buatlah class ConsoleApplication.java sebagai berikut
+ * buatlah class sesuai class diagram berikut
+ 
+ * class ReadInput dan WriteOutput merupakan Inner Class
+
+ #### inner class ReadInput
+ * extends Thread
+ * method run()
+ * lakukan proses berikut dalam blok try-catch
+ * Thread akan membaca input keyboard dari client dengan memanggil method inputString()
+ * Mengirimkan hasil input keyboard ke server melalui method writeStream() selama input dari client bukanlah kata "quit"
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+ #### inner class WriteOutput
+ * extends Thread
+ * method run()
+ * lakukan proses berikut dalam blok try-catch
+ * Thread akan menerima pesan yang dikirimkan dari server melalui method readStream()
+ * Menampilkan ke layar selama pesan dari server masih ada (bukan null)
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+ #### method startChat()
+ * lakukan proses berikut dalam blok try-catch
+ * Instansiasi objek ClientConnection
+ 
+ * Minta input alamat ip Server menggunakan method inputString()
+ * Koneksikan ip client ke server dengan memanggil method connect(ip)
+ 
+ * Instansiasi dan jalankan Thread ReadInput dan WriteInput
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+## Package chatGUI
+ ---
+Package berisi kelas view GUI dan controller
+
+### ChatView.java
+Buatlah class JFrame ChatView.java dengan tampilan sebagai berikut
+ 
+ * terdapat sebuah text area (txAreaChat)
+ * set editable text area = false (uncheck editable)
+ * tambahkan text "Input Server IP Address : " pada text area
+ 
+ * terdapat sebuah text field (txFieldChat)
+ * tambahkan method getTxFieldChat() yang mengembalikan objek text field txFieldChat
+ * tambahkan method getStringChat() yang mengembalikan String dari text field txFieldChat
+ * tambahkan method setTxFieldChat(String) yang mengeset String pada text field txFieldChat
+ * tambahkan method setTxAreaChat(String) yang menambahkan string pada baris baru pada text area txAreaChat
+ 
+ * import java.awt.event.ActionListener;
+ * tambahkan method addListener(ActionListener e)
+ * tambahkan add listener dengan memanggil method addActionListener pada text field txfieldChat
+ 
+
+### ChatController.java
+Buatlah class JChatController.java sebagai berikut
+ * buatlah class sesuai class diagram berikut
+ 
+ * class WriteOutput merupakan Inner Class
+ * import java.awt.event.ActionListener;
+ * kelas implements ActionListener
+ * implementasikan method actionPerformed(ActionEvent ae)
+
+#### Constructor ChatController
+ * Constructor menginstansiasi GUI view
+ * set visible view = true
+ * set lisener view dengan controller this
+ * set client = null
+ 
+
+#### inner class WriteOutput
+ * extends Thread
+ * method run()
+ * lakukan proses berikut dalam blok try-catch
+ * Thread akan menerima pesan yang dikirimkan dari server melalui method readStream()
+ * Menampilkan pesan ke text area view selama pesan dari server masih ada (bukan null) menggunakan method setTxAreaChat
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+
+#### method actionPerformed(ActionEvent ae)
+ * get Object source action event
+ 
+ * cek source action event
+ * jika event berasal dari text field (tekan tombol enter di text field), cek apakah client sudah terhubung
+ * jika client masih null
+ * lakukan proses berikut dalam blok try-catch
+ * instansiasi ClientConnection baru
+ * Terima string ip dari user dengan memanggil method getStringChat dari objek view
+ 
+ * Instansiasi dan jalankan objek WriteOutput
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+ * jika client sudah terbentuk (koneksi sudah terbentuk)
+ * terima input dari view menggunakan method getStringChat()
+ * kirimkan hasil input String ke server melalui method writeStream()
+ 
+ * hapus isi dari text field pada view menggunakan method setTxFieldChat
+ 
+
+## Package driver
+ ---
+Package berisi kelas-kelas model
+
+### DriverServer.java
+Buatlah class DriverServer.java sebagai berikut
+ * kelas memiliki main method (psvm)
+ * lakukan proses berikut dalam blok try-catch di dalam main method
+ * Instansiasi objek ServerConnection dan tampilkan informasi server dengan memanggil method getServerInformation()
+ 
+ * Lakukan perulangan untuk menjalankan ConnectionThread setiap server menerima Client baru
+ * Jalankan thread connection
+ 
+ * tambahkan pesan di blok catch untuk menampilkan pesan error
+ * Jalankan kelas DriverServer
+
+### DriverClientConsole.java
+Buatlah class DriverClient.java sebagai berikut
+ * kelas memiliki main method (psvm)
+ * instansiasi objek ConsoleApplication
+ * panggil method startChat dari objek ConsoleApplication
+ * Jalankan kelas DriverClientConsole
+ * hubungkan dengan IP server
+ * cobalah aplikasi chat console yang telah dibuat
+
+### DriverClientGui.java
+Buatlah class DriverClientGui.java sebagai berikut
+ * kelas memiliki main method (psvm)
+ * instansiasi objek ChatController
+ * Jalankan kelas DriverClientGui
+ * hubungkan dengan IP server
+ * cobalah aplikasi chat Gui yang telah dibuat
diff --git a/Task_4-master/Task_4/build.xml b/Task_4-master/Task_4/build.xml
new file mode 100644
index 0000000..a3f3a3b
--- /dev/null
+++ b/Task_4-master/Task_4/build.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project Task_4.
+
+
+
diff --git a/Task_4-master/Task_4/manifest.mf b/Task_4-master/Task_4/manifest.mf
new file mode 100644
index 0000000..1574df4
--- /dev/null
+++ b/Task_4-master/Task_4/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/Task_4-master/Task_4/nbproject/build-impl.xml b/Task_4-master/Task_4/nbproject/build-impl.xml
new file mode 100644
index 0000000..a230ab6
--- /dev/null
+++ b/Task_4-master/Task_4/nbproject/build-impl.xml
@@ -0,0 +1,1419 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No tests executed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/Task_4-master/Task_4/nbproject/genfiles.properties b/Task_4-master/Task_4/nbproject/genfiles.properties
new file mode 100644
index 0000000..c64a4d6
--- /dev/null
+++ b/Task_4-master/Task_4/nbproject/genfiles.properties
@@ -0,0 +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
diff --git a/Task_4-master/Task_4/nbproject/private/private.properties b/Task_4-master/Task_4/nbproject/private/private.properties
new file mode 100644
index 0000000..36fec3b
--- /dev/null
+++ b/Task_4-master/Task_4/nbproject/private/private.properties
@@ -0,0 +1,2 @@
+compile.on.save=true
+user.properties.file=C:\\Users\\ANDITYAARIFIANTO\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
diff --git a/Task_4-master/Task_4/nbproject/private/private.xml b/Task_4-master/Task_4/nbproject/private/private.xml
new file mode 100644
index 0000000..595a8e8
--- /dev/null
+++ b/Task_4-master/Task_4/nbproject/private/private.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+ file:/C:/Users/ANDITYAARIFIANTO/Documents/GitHub/Task_4/src/javaChat/ClientConnection.java
+ file:/C:/Users/ANDITYAARIFIANTO/Documents/GitHub/Task_4/src/javaChat/ServerConnection.java
+ file:/C:/Users/ANDITYAARIFIANTO/Documents/GitHub/Task_4/src/javaChat/Connection.java
+
+
+
diff --git a/Task_4-master/Task_4/nbproject/project.properties b/Task_4-master/Task_4/nbproject/project.properties
new file mode 100644
index 0000000..830d0e4
--- /dev/null
+++ b/Task_4-master/Task_4/nbproject/project.properties
@@ -0,0 +1,73 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processor.options=
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/Task_4.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=task.Task
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/Task_4-master/Task_4/nbproject/project.xml b/Task_4-master/Task_4/nbproject/project.xml
new file mode 100644
index 0000000..d0dada8
--- /dev/null
+++ b/Task_4-master/Task_4/nbproject/project.xml
@@ -0,0 +1,15 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ Task_4
+
+
+
+
+
+
+
+
+
diff --git a/Task_4-master/Task_4/src/javaChat/ClientConnection.java b/Task_4-master/Task_4/src/javaChat/ClientConnection.java
new file mode 100644
index 0000000..91e9c5a
--- /dev/null
+++ b/Task_4-master/Task_4/src/javaChat/ClientConnection.java
@@ -0,0 +1,56 @@
+/*
+ * 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 javaChat;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.Socket;
+
+/**
+ *
+ * @author dee
+ */
+public class ClientConnection {
+
+ private BufferedReader keyBoard;
+ private BufferedReader inputStream;
+ private PrintWriter outputStream;
+ final private int PORT = 4444;
+ private Socket client;
+
+ public ClientConnection() {
+ keyBoard = new BufferedReader(new InputStreamReader(System.in));
+ }
+
+ public void connect(String ip) throws IOException {
+ client = new Socket(ip, PORT);
+ inputStream = new BufferedReader(new InputStreamReader(client.getInputStream()));
+ outputStream = new PrintWriter(client.getOutputStream(), true);
+ }
+
+ public void disconnect() throws IOException {
+ keyBoard.close();
+ inputStream.close();
+ outputStream.close();
+ client.close();
+ }
+
+ public String inputString() throws IOException {
+ return keyBoard.readLine();
+ }
+
+ public String readStream() throws IOException {
+ return inputStream.readLine();
+ }
+
+ public void writeStream(String text) {
+ outputStream.println(text);
+ outputStream.flush();
+ }
+
+}
diff --git a/Task_4-master/Task_4/src/javaChat/Connection.java b/Task_4-master/Task_4/src/javaChat/Connection.java
new file mode 100644
index 0000000..2e73c20
--- /dev/null
+++ b/Task_4-master/Task_4/src/javaChat/Connection.java
@@ -0,0 +1,108 @@
+/*
+ * 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 javaChat;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * @author dee
+ */
+public class Connection {
+
+ private Socket client;
+ private String ipClient = "";
+ private BufferedReader inputStream;
+ private DataOutputStream outputStream;
+ private InetAddress destAddress;
+ private static ArrayList list = new ArrayList<>();
+// private static Map users = new HashMap<>();
+
+// public Connection(Socket client, String username) throws IOException {
+// this.client = client;
+// inputStream = new BufferedReader(new InputStreamReader(client.getInputStream()));
+//// outputStream = new DataOutputStream(client.getOutputStream());
+// users.put(username, new DataOutputStream(client.getOutputStream()));
+//
+// destAddress = this.client.getInetAddress();
+// byte ipAddress[] = destAddress.getAddress();
+// for (int i = 0; i < ipAddress.length; ++i) {
+// ipClient += String.valueOf((ipAddress[i] + 256) % 256) + ".";
+// }
+// }
+
+ public Connection(Socket client) throws IOException {
+ this.client = client;
+ list.add(client);
+ inputStream = new BufferedReader(new InputStreamReader(client.getInputStream()));
+ outputStream = new DataOutputStream(client.getOutputStream());
+
+ destAddress = this.client.getInetAddress();
+ byte ipAddress[] = destAddress.getAddress();
+ for (int i = 0; i < ipAddress.length; ++i) {
+ ipClient += String.valueOf((ipAddress[i] + 256) % 256) + ".";
+ }
+ }
+
+ public void disconnect() throws IOException {
+ list.remove(client);
+ inputStream.close();
+ outputStream.close();
+ client.close();
+ }
+
+ public String readStream() throws IOException {
+ return inputStream.readLine();
+ }
+
+ public void startChat(String text) throws IOException {
+ outputStream.writeBytes(text + "\n");
+ }
+
+ public void writeStream(String text) throws IOException {
+ outputStream.writeBytes(text + "\n");
+ outputStream.flush();
+ }
+
+ public void sendToAll(String s) {
+ for (Socket c : list) {
+ try {
+ if (c != null) {
+ DataOutputStream d = new DataOutputStream(c.getOutputStream());
+ d.writeBytes(s + "\n");
+ d.flush();
+ }
+ } catch (Exception e) {
+ System.out.println("error when send to all");
+ }
+ }
+ }
+
+ public String getIpClient() {
+ return ipClient;
+ }
+
+ public int getPortClient() {
+ return client.getPort();
+ }
+
+ public String getClientInformation() {
+
+ String s = " Host name is " + destAddress.getHostName()
+ + "\n IP address is " + this.ipClient
+ + "\n Port number is " + getPortClient();
+ return s;
+ }
+
+}
diff --git a/Task_4-master/Task_4/src/javaChat/ServerConnection.java b/Task_4-master/Task_4/src/javaChat/ServerConnection.java
new file mode 100644
index 0000000..093ed84
--- /dev/null
+++ b/Task_4-master/Task_4/src/javaChat/ServerConnection.java
@@ -0,0 +1,45 @@
+/*
+ * 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 javaChat;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+/**
+ *
+ * @author dee
+ */
+public class ServerConnection {
+
+ private ServerSocket serverSocket;
+ private InetAddress localAddress;
+ private String host;
+ private String ipServer = "";
+
+ public ServerConnection() throws IOException {
+ serverSocket = new ServerSocket(4444);
+ localAddress = InetAddress.getLocalHost();
+ host = localAddress.getHostName();
+ byte ipAddress[] = localAddress.getAddress();
+ for (int i = 0; i < ipAddress.length; ++i) {
+ ipServer += String.valueOf((ipAddress[i] + 256) % 256) + ".";
+ }
+ }
+
+ public Socket getClient() throws IOException {
+ return serverSocket.accept();
+ }
+
+ public String getServerInformation() {
+ String s = " Host name is " + host
+ + "\n IP address is " + ipServer
+ + "\n Port number " + 4444;
+ return s;
+ }
+
+}
diff --git a/Task_4-master/assets/01.JPG b/Task_4-master/assets/01.JPG
new file mode 100644
index 0000000..1fedd52
Binary files /dev/null and b/Task_4-master/assets/01.JPG differ
diff --git a/Task_4-master/assets/02.JPG b/Task_4-master/assets/02.JPG
new file mode 100644
index 0000000..0d5a0eb
Binary files /dev/null and b/Task_4-master/assets/02.JPG differ
diff --git a/Task_4-master/assets/03.JPG b/Task_4-master/assets/03.JPG
new file mode 100644
index 0000000..6e3924d
Binary files /dev/null and b/Task_4-master/assets/03.JPG differ
diff --git a/Task_4-master/assets/04.JPG b/Task_4-master/assets/04.JPG
new file mode 100644
index 0000000..b1c2dd5
Binary files /dev/null and b/Task_4-master/assets/04.JPG differ
diff --git a/Task_4-master/assets/05.JPG b/Task_4-master/assets/05.JPG
new file mode 100644
index 0000000..fbb91eb
Binary files /dev/null and b/Task_4-master/assets/05.JPG differ
diff --git a/Task_4-master/assets/06.JPG b/Task_4-master/assets/06.JPG
new file mode 100644
index 0000000..e8a6a42
Binary files /dev/null and b/Task_4-master/assets/06.JPG differ
diff --git a/Task_4-master/assets/07.JPG b/Task_4-master/assets/07.JPG
new file mode 100644
index 0000000..7090e7c
Binary files /dev/null and b/Task_4-master/assets/07.JPG differ
diff --git a/Task_4-master/assets/08.JPG b/Task_4-master/assets/08.JPG
new file mode 100644
index 0000000..9cfb164
Binary files /dev/null and b/Task_4-master/assets/08.JPG differ
diff --git a/Task_4-master/assets/09.JPG b/Task_4-master/assets/09.JPG
new file mode 100644
index 0000000..e1c77c3
Binary files /dev/null and b/Task_4-master/assets/09.JPG differ
diff --git a/Task_4-master/assets/10.JPG b/Task_4-master/assets/10.JPG
new file mode 100644
index 0000000..3cfd80a
Binary files /dev/null and b/Task_4-master/assets/10.JPG differ
diff --git a/Task_4-master/assets/11.JPG b/Task_4-master/assets/11.JPG
new file mode 100644
index 0000000..56b00a0
Binary files /dev/null and b/Task_4-master/assets/11.JPG differ
diff --git a/Task_4-master/assets/12.JPG b/Task_4-master/assets/12.JPG
new file mode 100644
index 0000000..65a66a7
Binary files /dev/null and b/Task_4-master/assets/12.JPG differ
diff --git a/Task_4-master/assets/13.JPG b/Task_4-master/assets/13.JPG
new file mode 100644
index 0000000..f0b0e98
Binary files /dev/null and b/Task_4-master/assets/13.JPG differ
diff --git a/Task_4-master/assets/14.JPG b/Task_4-master/assets/14.JPG
new file mode 100644
index 0000000..731c564
Binary files /dev/null and b/Task_4-master/assets/14.JPG differ
diff --git a/Task_4-master/assets/15.JPG b/Task_4-master/assets/15.JPG
new file mode 100644
index 0000000..4e171c8
Binary files /dev/null and b/Task_4-master/assets/15.JPG differ
diff --git a/Task_4-master/assets/16.JPG b/Task_4-master/assets/16.JPG
new file mode 100644
index 0000000..a674f72
Binary files /dev/null and b/Task_4-master/assets/16.JPG differ
diff --git a/Task_4-master/assets/17.JPG b/Task_4-master/assets/17.JPG
new file mode 100644
index 0000000..a4227f6
Binary files /dev/null and b/Task_4-master/assets/17.JPG differ
diff --git a/Task_4-master/assets/18.JPG b/Task_4-master/assets/18.JPG
new file mode 100644
index 0000000..023e1c7
Binary files /dev/null and b/Task_4-master/assets/18.JPG differ
diff --git a/Task_4-master/assets/19.JPG b/Task_4-master/assets/19.JPG
new file mode 100644
index 0000000..8a43b62
Binary files /dev/null and b/Task_4-master/assets/19.JPG differ
diff --git a/Task_4-master/assets/20.JPG b/Task_4-master/assets/20.JPG
new file mode 100644
index 0000000..cadb692
Binary files /dev/null and b/Task_4-master/assets/20.JPG differ
diff --git a/Task_4-master/assets/21.JPG b/Task_4-master/assets/21.JPG
new file mode 100644
index 0000000..973b4bb
Binary files /dev/null and b/Task_4-master/assets/21.JPG differ
diff --git a/Task_4-master/assets/22.JPG b/Task_4-master/assets/22.JPG
new file mode 100644
index 0000000..da7730e
Binary files /dev/null and b/Task_4-master/assets/22.JPG differ
diff --git a/Task_4-master/assets/23.JPG b/Task_4-master/assets/23.JPG
new file mode 100644
index 0000000..3e60b3b
Binary files /dev/null and b/Task_4-master/assets/23.JPG differ
diff --git a/Task_4-master/assets/24.JPG b/Task_4-master/assets/24.JPG
new file mode 100644
index 0000000..f59614d
Binary files /dev/null and b/Task_4-master/assets/24.JPG differ
diff --git a/Task_4-master/assets/25.JPG b/Task_4-master/assets/25.JPG
new file mode 100644
index 0000000..f9496f8
Binary files /dev/null and b/Task_4-master/assets/25.JPG differ
diff --git a/Task_4-master/assets/26.JPG b/Task_4-master/assets/26.JPG
new file mode 100644
index 0000000..0a9ad9a
Binary files /dev/null and b/Task_4-master/assets/26.JPG differ
diff --git a/Task_4-master/assets/27.JPG b/Task_4-master/assets/27.JPG
new file mode 100644
index 0000000..d0fb363
Binary files /dev/null and b/Task_4-master/assets/27.JPG differ
diff --git a/Task_4-master/build.xml b/Task_4-master/build.xml
new file mode 100644
index 0000000..03f4ad0
--- /dev/null
+++ b/Task_4-master/build.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project Task_4.
+
+
+
diff --git a/Task_4-master/manifest.mf b/Task_4-master/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/Task_4-master/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/Task_4-master/nbproject/build-impl.xml b/Task_4-master/nbproject/build-impl.xml
new file mode 100644
index 0000000..4abce43
--- /dev/null
+++ b/Task_4-master/nbproject/build-impl.xml
@@ -0,0 +1,1419 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No tests executed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/Task_4-master/nbproject/genfiles.properties b/Task_4-master/nbproject/genfiles.properties
new file mode 100644
index 0000000..cb2d623
--- /dev/null
+++ b/Task_4-master/nbproject/genfiles.properties
@@ -0,0 +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
diff --git a/Task_4-master/nbproject/private/private.properties b/Task_4-master/nbproject/private/private.properties
new file mode 100644
index 0000000..1b6c36a
--- /dev/null
+++ b/Task_4-master/nbproject/private/private.properties
@@ -0,0 +1,2 @@
+compile.on.save=true
+user.properties.file=C:\\Users\\ANDITYAARIFIANTO\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
diff --git a/Task_4-master/nbproject/private/private.xml b/Task_4-master/nbproject/private/private.xml
new file mode 100644
index 0000000..52e3867
--- /dev/null
+++ b/Task_4-master/nbproject/private/private.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+ file:/C:/Users/ANDITYAARIFIANTO/Documents/GitHub/Task_4/src/javaChat/ClientConnection.java
+ file:/C:/Users/ANDITYAARIFIANTO/Documents/GitHub/Task_4/src/javaChat/ServerConnection.java
+ file:/C:/Users/ANDITYAARIFIANTO/Documents/GitHub/Task_4/src/javaChat/Connection.java
+
+
+
diff --git a/Task_4-master/nbproject/project.properties b/Task_4-master/nbproject/project.properties
new file mode 100644
index 0000000..de16b77
--- /dev/null
+++ b/Task_4-master/nbproject/project.properties
@@ -0,0 +1,73 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processor.options=
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/Task_4.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=task.Task
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/Task_4-master/nbproject/project.xml b/Task_4-master/nbproject/project.xml
new file mode 100644
index 0000000..07d3ecf
--- /dev/null
+++ b/Task_4-master/nbproject/project.xml
@@ -0,0 +1,15 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ Task_4
+
+
+
+
+
+
+
+
+
diff --git a/Task_4-master/src/javaChat/ClientConnection.java b/Task_4-master/src/javaChat/ClientConnection.java
new file mode 100644
index 0000000..e79488e
--- /dev/null
+++ b/Task_4-master/src/javaChat/ClientConnection.java
@@ -0,0 +1,56 @@
+/*
+ * 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 javaChat;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.Socket;
+
+/**
+ *
+ * @author dee
+ */
+public class ClientConnection {
+
+ private BufferedReader keyBoard;
+ private BufferedReader inputStream;
+ private PrintWriter outputStream;
+ final private int PORT = 4444;
+ private Socket client;
+
+ public ClientConnection() {
+ keyBoard = new BufferedReader(new InputStreamReader(System.in));
+ }
+
+ public void connect(String ip) throws IOException {
+ client = new Socket(ip, PORT);
+ inputStream = new BufferedReader(new InputStreamReader(client.getInputStream()));
+ outputStream = new PrintWriter(client.getOutputStream(), true);
+ }
+
+ public void disconnect() throws IOException {
+ keyBoard.close();
+ inputStream.close();
+ outputStream.close();
+ client.close();
+ }
+
+ public String inputString() throws IOException {
+ return keyBoard.readLine();
+ }
+
+ public String readStream() throws IOException {
+ return inputStream.readLine();
+ }
+
+ public void writeStream(String text) {
+ outputStream.println(text);
+ outputStream.flush();
+ }
+
+}
diff --git a/Task_4-master/src/javaChat/Connection.java b/Task_4-master/src/javaChat/Connection.java
new file mode 100644
index 0000000..b049aaa
--- /dev/null
+++ b/Task_4-master/src/javaChat/Connection.java
@@ -0,0 +1,108 @@
+/*
+ * 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 javaChat;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * @author dee
+ */
+public class Connection {
+
+ private Socket client;
+ private String ipClient = "";
+ private BufferedReader inputStream;
+ private DataOutputStream outputStream;
+ private InetAddress destAddress;
+ private static ArrayList list = new ArrayList<>();
+// private static Map users = new HashMap<>();
+
+// public Connection(Socket client, String username) throws IOException {
+// this.client = client;
+// inputStream = new BufferedReader(new InputStreamReader(client.getInputStream()));
+//// outputStream = new DataOutputStream(client.getOutputStream());
+// users.put(username, new DataOutputStream(client.getOutputStream()));
+//
+// destAddress = this.client.getInetAddress();
+// byte ipAddress[] = destAddress.getAddress();
+// for (int i = 0; i < ipAddress.length; ++i) {
+// ipClient += String.valueOf((ipAddress[i] + 256) % 256) + ".";
+// }
+// }
+
+ public Connection(Socket client) throws IOException {
+ this.client = client;
+ list.add(client);
+ inputStream = new BufferedReader(new InputStreamReader(client.getInputStream()));
+ outputStream = new DataOutputStream(client.getOutputStream());
+
+ destAddress = this.client.getInetAddress();
+ byte ipAddress[] = destAddress.getAddress();
+ for (int i = 0; i < ipAddress.length; ++i) {
+ ipClient += String.valueOf((ipAddress[i] + 256) % 256) + ".";
+ }
+ }
+
+ public void disconnect() throws IOException {
+ list.remove(client);
+ inputStream.close();
+ outputStream.close();
+ client.close();
+ }
+
+ public String readStream() throws IOException {
+ return inputStream.readLine();
+ }
+
+ public void startChat(String text) throws IOException {
+ outputStream.writeBytes(text + "\n");
+ }
+
+ public void writeStream(String text) throws IOException {
+ outputStream.writeBytes(text + "\n");
+ outputStream.flush();
+ }
+
+ public void sendToAll(String s) {
+ for (Socket c : list) {
+ try {
+ if (c != null) {
+ DataOutputStream d = new DataOutputStream(c.getOutputStream());
+ d.writeBytes(s + "\n");
+ d.flush();
+ }
+ } catch (Exception e) {
+ System.out.println("error when send to all");
+ }
+ }
+ }
+
+ public String getIpClient() {
+ return ipClient;
+ }
+
+ public int getPortClient() {
+ return client.getPort();
+ }
+
+ public String getClientInformation() {
+
+ String s = " Host name is " + destAddress.getHostName()
+ + "\n IP address is " + this.ipClient
+ + "\n Port number is " + getPortClient();
+ return s;
+ }
+
+}
diff --git a/Task_4-master/src/javaChat/ServerConnection.java b/Task_4-master/src/javaChat/ServerConnection.java
new file mode 100644
index 0000000..8a1902e
--- /dev/null
+++ b/Task_4-master/src/javaChat/ServerConnection.java
@@ -0,0 +1,45 @@
+/*
+ * 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 javaChat;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+/**
+ *
+ * @author dee
+ */
+public class ServerConnection {
+
+ private ServerSocket serverSocket;
+ private InetAddress localAddress;
+ private String host;
+ private String ipServer = "";
+
+ public ServerConnection() throws IOException {
+ serverSocket = new ServerSocket(4444);
+ localAddress = InetAddress.getLocalHost();
+ host = localAddress.getHostName();
+ byte ipAddress[] = localAddress.getAddress();
+ for (int i = 0; i < ipAddress.length; ++i) {
+ ipServer += String.valueOf((ipAddress[i] + 256) % 256) + ".";
+ }
+ }
+
+ public Socket getClient() throws IOException {
+ return serverSocket.accept();
+ }
+
+ public String getServerInformation() {
+ String s = " Host name is " + host
+ + "\n IP address is " + ipServer
+ + "\n Port number " + 4444;
+ return s;
+ }
+
+}