Commit cbcdb910 authored by Stephen's avatar Stephen
Browse files

Really Final version

parent f2554465
========================
BUILD OUTPUT DESCRIPTION
========================
When you build an Java application project that has a main class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder. The IDE
also adds each of the JAR files to the Class-Path element in the application
JAR files manifest file (MANIFEST.MF).
To run the project from the command line, go to the dist folder and
type the following:
java -jar "TCPClient.jar"
To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.
Notes:
* If two JAR files on the project classpath have the same name, only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path element
specified in the manifest,the content of the Class-Path element has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.
========================
BUILD OUTPUT DESCRIPTION
========================
When you build an Java application project that has a main class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder. The IDE
also adds each of the JAR files to the Class-Path element in the application
JAR files manifest file (MANIFEST.MF).
To run the project from the command line, go to the dist folder and
type the following:
java -jar "TCPServer.jar"
To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.
Notes:
* If two JAR files on the project classpath have the same name, only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path element
specified in the manifest,the content of the Class-Path element has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.
......@@ -59,6 +59,7 @@ public class MainPage extends javax.swing.JFrame {
private int OfferedItemId = -1;
private int DemandedItemId = -1;
private int FindId = -1;
private Long curr_time;
private Date currentTime;
private Date time;
private Timer timer;
......@@ -1740,14 +1741,13 @@ public class MainPage extends javax.swing.JFrame {
Long timeLong = response.getLong("time");
time = new Date(Long.parseLong(timeLong.toString())*1000);
timeLabel.setText("Time: "+time);
curr_time = timeLong;
//Create timer for Current Time
timer=new Timer(1000,new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
currentTime = new Date();
String formateDate=sdf.format(currentTime);
curr_time++;
currentTime = new Date(Long.parseLong(curr_time.toString())*1000);
currenttimeLabel.setText("Current Time: "+currentTime.toString());
}
});
......
......@@ -680,32 +680,32 @@ public class TCPClient {
return responseJSON;
}
public static void main(String argv[]) throws Exception
{
TCPClient client = new TCPClient("localhost", 6789);
JSONObject response = client.login("ayam", "ayam");
if(response.getString("status").equals("ok")) {
client.token = response.getString("token");
client.x=response.getInt("x");
client.y=response.getInt("y");
}
System.out.println(response.toString());
response = client.map();
System.out.println(response.toString());
response = client.offer(client.token, 2, 5, 7, 3);
System.out.println(response.toString());
response = client.offer(client.token, 2, 1, 7, 3);
System.out.println(response.toString());
response = client.sendFind(client.token, 2);
System.out.println(response.toString());
// public static void main(String argv[]) throws Exception
// {
// TCPClient client = new TCPClient("localhost", 6789);
//
// JSONObject response = client.login("ayam", "ayam");
// if(response.getString("status").equals("ok")) {
// client.token = response.getString("token");
// client.x=response.getInt("x");
// client.y=response.getInt("y");
// }
// System.out.println(response.toString());
//
// response = client.map();
// System.out.println(response.toString());
//
// response = client.offer(client.token, 2, 5, 7, 3);
// System.out.println(response.toString());
//
// response = client.offer(client.token, 2, 1, 7, 3);
// System.out.println(response.toString());
//
// response = client.sendFind(client.token, 2);
// System.out.println(response.toString());
//
// response = client.findoffer(2);
// System.out.println(response.toString());
}
// }
}
#Sun, 26 Apr 2015 14:21:29 +0700
#Sun, 26 Apr 2015 17:23:09 +0700
C\:\\Users\\Stephen\\Documents\\NetBeansProjects\\TubesSister\\src\\server=
Supports Markdown
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