Java GUI Framework Question:
Download Questions PDF

Does Swing is thread safe? What do you mean by swing is not thread-safe?

Java GUI Framework Interview Question
Java GUI Framework Interview Question

Answer:

This swing interview questions is getting very popular now days. Though it’s pretty basic many developer doesn't understand thread-safety issue in Swing. Since Swing components are not thread-safe it means you can not update these components in any thread other than Event-Driven-Thread. If you do so you will get unexpected behavior. Some time interviewer will also ask what are thread-safe methods in swing which can be safely called from any thread only few like repaint() and revalidate().

Download Java GUI Framework Interview Questions And Answers PDF

Previous QuestionNext Question
What is Event-Driven-Thread (EDT) in Swing?What are differences between Swing and AWT?