Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Single-Thread Rule (p. 806 at the end of chap. 14) states: \"Do not touch Sw

ID: 3572849 • Letter: T

Question

The Single-Thread Rule (p. 806 at the end of chap. 14) states: "Do not touch Swing components in any thread other than the event dispatch thread." Which of the following related design rules has changed beginning with Java 1.6? a. If an action triggered by swing event takes a long time, start a new thread to do the work. b. If an method can block on input or output, start a new thread to do the work. c. If you need to wait for a specific amount of time, start a new thread to sleep. d. You can safely add or remove event listeners in any thread. e. You can construct components, set their properties, and add them to containers as long as none of the components have been realized.

Explanation / Answer

The correct option is E.

Before Java release the version 1.6 it was acceptable to add componets to the containers without realizing them. After changes to the Java 1.6 now we need to add certain methods for event queing in java for the components. Therefore the correct optin is E.

You can construct components, set their properties, and add them to containers as long as none of the components have been realized.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote