have you ever have this kind of display..when running an applet ?

java-sc.png

while the code is just like this..

Socket s = null;
try {
s = new Socket(getCodeBase().getHost(),Integer.parseInt(p.getProperty(“image.1.port”)));
// changed the status.. to state that we’re connected?
status.setText(“Connected to:” + getCodeBase().getHost() + “:” + p.getProperty(“image.1.port”));
OutputStream slout = s.getOutputStream();
BufferedWriter bw = new BufferedWriter(
new OutputStreamWriter(slout));
bw.write(“GET ” + imageURL2 + ” HTTP/1.0 rnn”);
status.setText(“Written : ” + imageURL2 + “to socket.”);
//close it
BufferedReader br = new BufferedReader(
new InputStreamReader(s.getInputStream()));

System.out.println(br.readLine());

bw.close();
s.close();
} catch (IOException e)
{
//e.printStacktrace();
}

Related posts:

  1. Socket…in java
  2. VPN status
  3. java
  4. Java 1.6 update 21 for CentOS 5.5
  5. Geoserver and Java (JRE)