XXX Chats

Truth about sex chat

Updating jtextarea

Swing uses one particular thread to call things like your mouse Clicked() - the so called event dispatch thread (EDT).

Painting is also done on this thread which explains why mouse Clicked() must complete before anything "shows up". Your mouse Clicked() should use another thread to do it's work, updating the gui when it's done.

like this: ---------------- first log_______ | second log_____| third log______ \/ ---------------- Someone can help me ...public void create And Show GUI() { // Creates the JFrame JFrame my Frame = new JFrame("Inferno Shoutbox"); //Creating the text area, and makes it non-editable JText Area my Area = new JText Area(5, 5); my Editable(false); //Writes a simple message to the JTex TArea my Area.append(get() new Line); //Loads the text Area on our applet my Content Pane().add(my Area, Border Layout.

The problem is that the old text does not disappear, and the new text is pasted on top, making it unreadable. Could any of you please help me with this problem: I have a JText Area that needs to update while my program is running.

The method that should do the update, looks like this: public void alg() { ..... Use separate threads for stderr and stdout, otherwise you're serialising reading from these two streams. Don't append to the JText Area directly from these threads, push it back to the Swing event queue using Swing Utils.invoke Later() in order to avoid threading issues. Calling wait For() after reading from stderr and stdout doesn't make sense, as both ...

Any ideas or suggestions would be greatly appreciated.

if my file is too large, even though i have scrollbars, i am not able to display the files when it exceeds the Textarea size. My program currently updates a Jtext Area dynamically with the append method by starting a new thread. public void write Line(final String text) { Runnable update GUI = new Runnable() ; Thread t = new Thread(update GUI); t.start(); ...

I created a swing GUI with a text area to display the process of the application. My problem is, each log that join to the textarea go to the first line...

updating jtextarea-77

like this: ----------------- third log_______/\ second log_____| first log_______ | ----------------- I want to do the inverse...

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 would like my program(the main thread) to wait in this procedure until the new thread(that updates the GUI) has finished.

If i use the join() method the jtextarea updates but not dynamically, it waits until the proc panel Text Output Text(text) has finished processing before updating.

You will not have been able to read and understand that whole tutorial in under 7 minutes. but to be fair to me this tutorial still does not answer the question of how to pause a thread in effectively the same way as my suggested loop without the overheads.

However I appreciate the sort of help provided here so many thanks to people who spend there time helping persons such as myself kindness prevails.

Comments Updating jtextarea

  • Dynamic JTextArea Java Swing Q&A - Java2s
    Reply

    Java Swing Approach for dynamically appending text in text area, have scrollbar update What is the general approach with Java swing to update a textarea with lines of text say from a Thread and then have the text caret flow to the bottom of.…