From 0a936045b4fcdfaa2087e6494822a348ab8a91b6 Mon Sep 17 00:00:00 2001 From: Navdeep_Mishra Date: Sat, 3 Oct 2020 11:29:26 +0530 Subject: [PATCH] some code changes --- ChitChatApp.form | 365 ----------------------------------------------- ChitChatApp.java | 26 ++-- 2 files changed, 13 insertions(+), 378 deletions(-) delete mode 100644 ChitChatApp.form diff --git a/ChitChatApp.form b/ChitChatApp.form deleted file mode 100644 index 260cde4..0000000 --- a/ChitChatApp.form +++ /dev/null @@ -1,365 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ChitChatApp.java b/ChitChatApp.java index f57ddc0..b147b6b 100644 --- a/ChitChatApp.java +++ b/ChitChatApp.java @@ -2,7 +2,7 @@ import java.awt.*; import java.awt.event.*; import java.io.*; -import java.sql.*; + import java.net.*; @@ -269,7 +269,7 @@ private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed // TODO add your handling code here: - if (jRadioButton1.isSelected()) + if (jRadioButton1.isSelected()) //Connect funcitonality for the host. { new Thread(new Runnable() { @@ -370,7 +370,7 @@ public void run() } }).start(); } - if (jRadioButton2.isSelected()) + if (jRadioButton2.isSelected()) //connect functionality for the client { new Thread(new Runnable() { @@ -480,7 +480,7 @@ public void run() private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed - new Thread(new Runnable() + new Thread(new Runnable() //sends the message { public void run() { @@ -536,7 +536,7 @@ private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed - if(jRadioButton1.isSelected()) + if(jRadioButton1.isSelected()) //Disconnect Function if host option selected { new Thread(new Runnable() { @@ -569,7 +569,7 @@ public void run() }).start(); } - if(jRadioButton2.isSelected()) + if(jRadioButton2.isSelected()) //Disconnect Function if client option selected { new Thread(new Runnable() { @@ -607,8 +607,8 @@ public void run() private void jTextArea2PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jTextArea2PropertyChange // TODO add your handling code here: }//GEN-LAST:event_jTextArea2PropertyChange -void statusVerifier(boolean status1) -{ +void statusVerifier(boolean status1) //One of the most important funciton which verifies the status that the application +{ //connected or disconnected and perform the some gui operations. if(status1==false && cstatus=="Disconnected") { try @@ -679,8 +679,8 @@ else if(status1==true && cstatus=="Connected") } } -void firsttimestatusverifier(boolean status2) -{ +void firsttimestatusverifier(boolean status2) //This function disables some option when the gui is started. So that user can start the +{ // application without encountering any bug. if(status2 == false && cstatus=="Disconnected") { try @@ -739,9 +739,9 @@ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { - ChitChatApp root = new ChitChatApp(); - root.setVisible(true); - root.firsttimestatusverifier(false); + ChitChatApp root = new ChitChatApp(); //initializing the main gui + root.setVisible(true); //making it visible + root.firsttimestatusverifier(false); // verify the status of the app for the first time.