0

this all what i get from console
Java Plug-in 10.3.1.255
Using JRE version 1.7.0_03-b05 Java HotSpot(TM) Client VM
User home directory = D:\Documents and Settings\ali
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

0

Why didn't any of the printlns from your applet show on the java console? Add some more printlns to the applet to see if any part of the applet is executing.

0

i put print statement before the defenition of the socket and the statement appered but the statement after the defeition of the socket doesnot appered

0

the statement after the defeition of the socket doesnot appered

What has changed now? Before you said:

thank you for your help the print statement is now apppered

Then the printStackTrace statement must be called because of an exception at the socket statement.

One or the other MUST happen!!!

0

when i said the print statement appered that when i run the applet alone without displaying it on a web page

0

if i put this code only the first print statement is displayed

private void button1MouseClicked(java.awt.event.MouseEvent evt) {                                     
        // TODO add your handling code here:
        try{
             System.out.println("hello");
            // this.textField2.setText(textField1.getText());
      Socket dd=new Socket("127.0.0.1",3000);
      System.out.println("hello");
      DataInputStream c=new DataInputStream(dd.getInputStream());
      DataOutputStream c1=new DataOutputStream(dd.getOutputStream());
      c1.writeUTF("hello");
 System.out.println("yeeeeeeeeeeeeee");

}
catch(Exception et){
  et.getStackTrace();  
}
    }
0

All the printed messages should be unique so you know which println printed the message.
You have two printlns that print the same message.

Why do you have this statement?

et.getStackTrace();
0

I've never used that method. How does your code use it?
What does your code do with the value returned by that method?

0

In case of a GUI you need to define another method parametres like an another instance of variable to use.. try that it will work.. honestly I never tried an UDP with TCP however it will work if you initiate a new instance for the GUI

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.