Updating jtextfield

Rated 3.81/5 based on 525 customer reviews

I am not really getting it..you are updating swing components from an outside thread, you just need to do it via Swing Utilities.invoke Later() and it should work.

Why do you need another Thread within the write Log method?

programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums I know others have posted about this, but I am still not understanding how this is supposed to work.

My thought was to have a Log Handler class to which I would pass a JText Field.

import *; import *; import *; import *; import javax.swing.*; // // Set up a place to for all methods to call for logging results either to // the field in the main dialog or to a file.

public final class Log Handler I was hoping to use the area as a status of where things were at the moment.

I had a request to provide feedback to the user between when they made a change and when the GUI was updated with the final values.

updating jtextfield-29

updating jtextfield-44

updating jtextfield-27

updating jtextfield-9

To simplify things a little, the program has an Observable Value.I have been trying to get JText Field updating in a separate thread, but with no luck.The println shows messages scrolling in the text window, but I don't see them in the text field, just the last one, so I assume they are still all updating at once when the event queue empties.What happens in practice is that the user makes a change, the processes start up, I see their messages echoed in the Command Prompt window, but not the JText Field, and then when the processes finish, the JText Field updates.This is whether I just have the set Text line, the set Text as a Runnable I invoke Later, or fire it off as its own Thread.

Leave a Reply