Can anybody say to me, why it can appear? When Thread is working, it happens.
Asked
Active
Viewed 147 times
0
-
I agree, but AWT_TextField have method ValueChanged, JTextField doesn't have it, but i NEED it:( Thanks for asking;) – Aero Apr 28 '14 at 20:35
-
Use a `JTextField` and add a `DocumentListener`. – Andrew Thompson Apr 28 '14 at 22:02
-
Don't block the EDT (Event Dispatch Thread) - the GUI will 'freeze' when that happens. Instead of calling `Thread.sleep(n)` implement a Swing `Timer` for repeating tasks or a `SwingWorker` for long running tasks. See [Concurrency in Swing](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/) for more details. – Andrew Thompson Apr 29 '14 at 07:33
1 Answers
0
That's because AWT and Swing are rendered in a different manner. It's not recommended mixing both AWT and Swing components.
You can learn more about it here:
http://www.comp.nus.edu.sg/~cs3283/ftp/Java/swingConnect/archive/tech_topics_arch/mixing/mixing.html

Community
- 1
- 1

angel_navarro
- 1,757
- 10
- 11