threads
My problem is to have the two class below to run in 2 parallel threads. I have been advised to use a work thread but its some hard stuff for a java beginner like me. Plze can I get a hand?
class 1
publicclass ttteer{
private SimpleRead;
public ttteer(){
Read =new SimpleRead(this);
}
publicvoid setData(String s){
//the code here set the text in GUI
}
publicstaticvoid main(String[] args)throws IOException{
SwingUtilities.invokeLater(new Runnable(){
publicvoid run(){
try{
ttteer application =new ttteer();
application.getJFrame().setVisible(true);
}catch(IOException w){
}
}
});
}
}
class 2
publicclass SimpleRead{
public SimpleRead(){
//the code here opens the serial port
}
publicvoid serialEvent(SerialPortEvent event){
//here i read the data from the serial port whenever there is a serial port event
}
publicvoid writeToport(){
//here I write to the port
}
}

