Results 1 to 2 of 2

Thread: swingworker

  1. #1
    musiigedeo is offline Member
    Join Date
    Jul 2007
    Posts
    13
    Rep Power
    0

    Default swingworker

    Hey Guys
    Am sending data to the serial port a byte at a time and a response is recieved at the serialport for every sent byte.

    My problem is that all the responses are displayed in the application after all the bytes are sent. I want each response to be shown in the application when it's recieved and not after all the bytes are sent. I am trying to use the swingworker to manage my threads, but I just cannot get it to work. Plze give me a hand

    NB. I have attached the class ttteer which runs the GUI and the class SimpleRead.java which has the method "serialEvent(SerialPortEvent event)" that reads from the serial port when ever there is an event and the method writeToport() that writes to the port.
    Attached Files Attached Files

  2. #2
    musiigedeo is offline Member
    Join Date
    Jul 2007
    Posts
    13
    Rep Power
    0

    Default SwingUtilities.invokeAndWait

    I have modifeid the attached code to use SwingUtilities.invokeAndWait to update the GUI whenever data is detected on the serial port. But It just does't work... what am I doing wrong guys?
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •