1
- <<<<<<< HEAD
2
1
/*
3
2
* To change this license header, choose License Headers in Project Properties.
4
3
* To change this template file, choose Tools | Templates
7
6
package file_sharing ;
8
7
import java .awt .event .WindowAdapter ;
9
8
import java .awt .event .WindowEvent ;
10
- =======
11
- package file_sharing ;
12
-
13
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
14
9
import java .io .DataInputStream ;
15
10
import java .io .DataOutputStream ;
16
11
import java .io .File ;
27
22
import javax .swing .JFileChooser ;
28
23
29
24
import javax .swing .JFileChooser ;
30
- <<<<<<< HEAD
31
25
import javax .swing .JFrame ;
32
26
import javax .swing .JOptionPane ;
33
27
41
35
class Client {
42
36
43
37
44
- =======
45
- class Client {
46
-
47
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
48
38
}
49
-
50
39
public class Client_Main extends javax .swing .JFrame {
51
40
52
- public Socket socket = null ;
53
- private DataInputStream input = null ;
41
+ public Socket socket = null ;
42
+ private DataInputStream input = null ;
54
43
private DataOutputStream out = null ;
55
- public void setupconnection (String ip ,int port ){
56
- try
44
+ public void setupconnection (String ip ,int port ) {
45
+
46
+
47
+ try
57
48
{
58
49
this .socket = new Socket (ip , port );
59
50
System .out .println ("Connection Established!" );
@@ -67,31 +58,25 @@ public void setupconnection(String ip,int port){
67
58
{
68
59
System .out .println (i );
69
60
}
70
- <<<<<<< HEAD
71
61
}
72
62
73
63
74
- =======
75
- }
76
-
77
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
78
64
/**
79
65
* Creates new form Client_Main
80
66
*/
81
67
public Client_Main () {
82
68
initComponents ();
83
69
}
84
- <<<<<<< HEAD
85
70
86
71
/**
87
72
* This method is called from within the constructor to initialize the form.
88
73
* WARNING: Do NOT modify this code. The content of this method is always
89
74
* regenerated by the Form Editor.
90
75
*/
91
- =======
92
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
93
76
@ SuppressWarnings ("unchecked" )
77
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
94
78
private void initComponents () {
79
+
95
80
ipaddress = new javax .swing .JTextField ();
96
81
port_no = new javax .swing .JTextField ();
97
82
connect = new javax .swing .JButton ();
@@ -176,25 +161,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
176
161
);
177
162
178
163
pack ();
179
- }
164
+ }// </editor-fold>//GEN-END:initComponents
180
165
181
- <<<<<<< HEAD
182
166
private void connectActionPerformed (java .awt .event .ActionEvent evt ) {//GEN-FIRST:event_connectActionPerformed
183
167
// TODO add your handling code here:
184
168
185
- =======
186
- private void connectActionPerformed (java .awt .event .ActionEvent evt ) throws IOException {
187
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
188
169
ip = this .ipaddress .getText ();
189
170
pn = Integer .parseInt (this .port_no .getText ());
190
171
user = this .username .getText ();
191
172
this .setupconnection (ip , pn );
192
- <<<<<<< HEAD
193
- =======
194
- Logger logger = Logger .getLogger ("mylog" );
195
-
196
- FileHandler fileHandler = new FileHandler ("E:\\ file_sharing\\ File_Sharing\\ Filapplogg.log" , true );
197
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
198
173
199
174
if (this .socket !=null && user !=null ){
200
175
@@ -225,20 +200,20 @@ public void windowClosing(WindowEvent evt) {
225
200
}
226
201
227
202
228
- }
203
+ }//GEN-LAST:event_connectActionPerformed
229
204
230
205
private void port_noActionPerformed (java .awt .event .ActionEvent evt ) {//GEN-FIRST:event_port_noActionPerformed
231
206
// TODO add your handling code here:
232
- }
207
+ }//GEN-LAST:event_port_noActionPerformed
208
+
233
209
private void usernameActionPerformed (java .awt .event .ActionEvent evt ) {//GEN-FIRST:event_usernameActionPerformed
234
210
// TODO add your handling code here:
235
- }
211
+ }//GEN-LAST:event_usernameActionPerformed
236
212
237
213
private void ipaddressActionPerformed (java .awt .event .ActionEvent evt ) {//GEN-FIRST:event_ipaddressActionPerformed
238
214
// TODO add your handling code here:
239
- }
215
+ }//GEN-LAST:event_ipaddressActionPerformed
240
216
241
- <<<<<<< HEAD
242
217
/**
243
218
* @param args the command line arguments
244
219
*/
@@ -248,9 +223,6 @@ public static void main(String args[]) {
248
223
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
249
224
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
250
225
*/
251
- =======
252
- public static void main (String args []) {
253
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
254
226
try {
255
227
for (javax .swing .UIManager .LookAndFeelInfo info : javax .swing .UIManager .getInstalledLookAndFeels ()) {
256
228
if ("Nimbus" .equals (info .getName ())) {
@@ -279,15 +251,13 @@ public void run() {
279
251
private String ip ;
280
252
private int pn ;
281
253
private String user ;
282
- <<<<<<< HEAD
283
254
// Variables declaration - do not modify//GEN-BEGIN:variables
284
- =======
285
- >>>>>>> 0f 9d 468f 3e4 b42a1a7e306420f7e5335f9eee4ea
286
255
private javax .swing .JButton connect ;
287
256
private javax .swing .JTextField ipaddress ;
288
257
private javax .swing .JLabel jLabel1 ;
289
258
private javax .swing .JLabel jLabel2 ;
290
259
private javax .swing .JLabel jLabel3 ;
291
260
private javax .swing .JTextField port_no ;
292
261
private javax .swing .JTextField username ;
262
+ // End of variables declaration//GEN-END:variables
293
263
}
0 commit comments