Hi frds, i'm using client and Server communication using Sockets by using Swings,how can i call a method using thread which hve to run till da prgm exit.
The method inludes reading of data stream continusly whn ever send button is clicked.i'm using NetBeans. Pgm is.... package networking;
class Ser extends javax.swing.JFrame implements Runnable
PortNo = new javax.swing.JLabel();
PortNoTF = new javax.swing.JTextField();
Start = new javax.swing.JButton();
Message = new javax.swing.JLabel();
MessageTF = new javax.swing.JTextField();
Send = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
ServerDisplayTA = new javax.swing.JTextArea();
DisConnect = new javax.swing.JButton();
as this is your stated problem
> how can i call a method using thread which hve to run till da prgm exit.
forget your program for the moment, and just write a sample program,
jframe with a Jbutton and actionlistener to do your thread stuff (can be just a System.out.println)
have a go, and if you can't work it out, after visiting the thread tutorials and/or googling "new Thread",
post your sample program here, so we can help you work it out. Then you should be able to adapt the
same principles to your main program.
when posting code - use the code button (paste your code between the tags)