Event Dispatching Thread - Swing and Thread Safety

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:

    The swing of milk was tufted in the pap....
    Dylan Thomas (1914–1953)

    Tom Hyde, the tinker, standing on the gallows, was asked if he had anything to say. “Tell the tailors,” said he, “to remember to make a knot in their thread before they take the first stitch.” His companion’s prayer is forgotten.
    Henry David Thoreau (1817–1862)

    [As teenager], the trauma of near-misses and almost- consequences usually brings us to our senses. We finally come down someplace between our parents’ safety advice, which underestimates our ability, and our own unreasonable disregard for safety, which is our childlike wish for invulnerability. Our definition of acceptable risk becomes a product of our own experience.
    Roger Gould (20th century)