regarding the getText() method

Pentium 4 / 80 GB PORSCHE DESIGN
January 16, 2009 at 20:41:23
Specs: Windows XP, 1 gb
whenever i try to access the text field using using the code it seems the value is not accepted from the text field ...
i have bolded the lines...
SMSframe is the GUI form...


public class SMSClient implements Runnable{

public final static int SYNCHRONOUS=0;
public final static int ASYNCHRONOUS=1;
private Thread myThread=null;

private int mode=-1;
private String recipient=null;
private String message=null;

public int status=-1;
public long messageNo=-1;
SMSFrame frame=new SMSFrame();

SMSClient() {
throw new UnsupportedOperationException("Not yet implemented");
}
public void smsno(){
recipient=frame.Nofield.getText();

}
public void mess(){
message=frame.Messagefield.getText();


}

public SMSClient(int mode) {
this.mode=mode;

}

public int sendMessage (){


System.out.println("recipient: " + recipient + " message: " + message);
myThread = new Thread(this);
myThread.start();
run();
return status;
}
public void run(){

Sender aSender = new Sender(recipient,message);

try{


if (mode==SYNCHRONOUS) {
while (aSender.status == -1){
myThread.sleep (1000);
}
}
if (aSender.status == 0) messageNo=aSender.messageNo ;

}catch (Exception e){

e.printStackTrace();

}

this.status=aSender.status ;

aSender=null;


}


public static void main(String args[]){
SMSClient sms=new SMSClient(1);
sms.sendMessage();
}


}

the gui form is....the main part...

private void OkbuttonActionPerformed(java.awt.event.ActionEvent evt) {
SMSClient sms=new SMSClient(1);
sms.smsno();
sms.mess();
sms.sendMessage();
// TODO add your handling code here:
}


See More: regarding the getText() method

Report •


#1
January 18, 2009 at 09:17:20
i have tried differnet variations but still doesnt work.

Report •
Related Solutions


Ask Question