JDeveloper, thread and user interaction
Hello,
I'm developing a JDeveloper Swing application that receives data from a scale to be printed on the screen (this is done in a thread). At the same time, the user can interact with the screen and update fields. Sometimes I experience that my application blocks, and I have to restart. I believe that this is because the screen is updated by the two threads (scale and user) at the same time (?).. Does anyone know how to avoid this?
/Jakob
[465 byte] By [
jakob_ma] at [2007-11-26 19:02:21]

# 4
Ok, thank you..
I now use a Swing timer to call the actionPerformed(..) methode.
In this methode I update a text field on the screen, whenever the weight is changing.
What about "normal" user updates to GUI, i.e. combobox dropdowns, field updates etc ? Do I have to handle these events in the same actionPerformed(..) methode as the timer thread is calling, or may I define an actionListener for each component containing its own actionPerformed(..) methode ?
If I have to use the same actionPerformed(..) for all GUI updates, should this methode be defined synchronized, like
public synchronized void actionPerformed(ActionEvent e) ?
Regards Jakob