Commit 73e153ea authored by Jesus's avatar Jesus
Browse files

Initial commit

parent 8f00f3f8
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/Downloads/jsoup-1.13.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/jarCollection/poi-3.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/jarCollection/jxl.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Java EE 6-Java EE 6" level="project" />
</component>
</module>
\ No newline at end of file
ip=127.0.0.1
port=6666
dbpath=client.db
\ No newline at end of file
package com.jesus.chatclient;
import com.jesus.chatclient.ui.LoginFrame;
import javax.swing.*;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
public class ClientMain {
/**
* Entry class of Client side.
* @param args
*/
public static void main(String[] args) {
connection();
new LoginFrame();
}
public static void connection() {
/**
* Get a connection to server.
*/
String ip = DataBuffer.configProp.getProperty("ip");
int port = Integer.parseInt(DataBuffer.configProp.getProperty("port"));
try {
DataBuffer.clientSeocket = new Socket(ip, port);
DataBuffer.oos = new ObjectOutputStream(DataBuffer.clientSeocket.getOutputStream());
DataBuffer.ois = new ObjectInputStream(DataBuffer.clientSeocket.getInputStream());
} catch (Exception e) {
JOptionPane.showMessageDialog(new JFrame(),
"Check client.properties for server connection","Unable to connect to server", JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment