Categories: Personal

Java.. applet.. weirdo?

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

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 \r\n\n”);
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();
}

Namran Hussin

Leave a Comment
Share
Published by
Namran Hussin

Recent Posts

How you can speak with clarity and influence

Here are five key communication skills that help you speak with clarity and influence: Speak…

7 months ago

? Man360 Academy Q&A Session Video Access – Empower Your Masculine Growth Journey

Are you ready to unlock your full potential as a man?Discover powerful insights, real-life transformations,…

1 year ago

A note to remember

One day we will set aside one whole day to review the whole lesson we…

1 year ago

Dev Fest KL 2024

Last weekend, 07/12/2024 I managed to join Dev Fest Kuala Lumpur 2024, organized by Google…

1 year ago

TIPS BACAAN AL-QURAN

TIPS BACAAN AL-QURANOleh: Dr. Muhd al-Muhaysni.1. Jangan engkau berikan (fokus membaca) al-Quran pada lebihan waktumu…

2 years ago

Selawat 300 ribu kali

Selawat yang ringkas, yang mana apabila kamu membacanya satu kali sebanding 100 ribu kali, jadi…

2 years ago