wood burning stoves 2.0*
The moose likes Threads and Synchronization and the fly likes Multithreading with text input and Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Multithreading with text input and Swing" Watch "Multithreading with text input and Swing" New topic

Multithreading with text input and Swing

Martin Ivanov

Joined: Nov 06, 2012
Posts: 1
Hey guys,
I have a lot of problems with the threads. I have a task: you have a textarea and 3 threads : the first one gets the chars, the second - the words, the third - the sentences. My problem is that it should be done in real time - as long as the user inputs, in the same the three thread must do their job and print in 3 windows. I made it - but the problem is that the threads runs only after hitting enter when you finish writing text.
Can you give me some help how can I do it ? Thanks
Steve Luke

Joined: Jan 28, 2003
Posts: 4167

This is most likely a swing question, and you didn't TellTheDetails so anything I suggest is just a guess. Provide more info if this doesn't apply.

You are probably using an ActionListener to listen for changes in the text area, if you want to listen to every key press you should either use a key listener or key bindings on the text area.

I agree. Here's the link: http://aspose.com/file-tools
subject: Multithreading with text input and Swing
Similar Threads
why collections.binarysearch() returns wrong output for 1st 2 index position ?
Manage Threads Websphere Application Servers
Adjust font size according to resolution change (or different screen size)
Thread that gets the value from 3 Threads
Where is the Context Switch Effect in Java?