Swing and Thread Safety
Most AWT and Swing object methods are not thread safe: invoking them from multiple threads risks thread interference or memory consistency errors. To avoid these problems, Swing standards state that all user interface components should be created and accessed only from the AWT event dispatch thread. A popular third-party Look and Feel named Substance goes as far as to refuse to instantiate any Swing component when not running within the Event Dispatch Thread, to prevent such a coding mistake from occurring.
Read more about this topic: Event Dispatching Thread
Famous quotes containing the words swing, thread and/or safety:
“And I have asked to be
Where no storms come,
Where the green swell is in the havens dumb,
And out of the swing of the sea.”
—Gerard Manley Hopkins (18441889)
“Theres something like a line of gold thread running through a mans words when he talks to his daughter, and gradually over the years it gets to be long enough for you pick up in your hands and weave into a cloth that feels like love itself. Its another thing, though, to hold up that cloth for inspection.”
—John Gregory Brown (20th century)
“There is no calamity which a great nation can invite which equals that which follows a supine submission to wrong and injustice and the consequent loss of national self-respect and honor, beneath which are shielded and defended a peoples safety and greatness.”
—Grover Cleveland (18371908)