NOTA: La traducción de esta documentación es un esfuerzo personal y voluntario, no es un documento oficial de Sun Microsystems ni Oracle ni está patrocinado por ninguna de estas empresas. Los documentos originales (en inglés) están disponibles en: http://java.sun.com/docs/books/tutorial/.
Dirija cualquier comentario, petición, felicitación, etc. a tutorialesjava_@RROBA_codexion.com.
Si desea ayudar a mantener en funcionamiento esta web, colaborar con la traducción de estos documentos o necesita que se traduzca algĂșn capĂ­tulo en concreto puede realizar una donación directa mediante Paypal:
Questions and Exercises: Concurrency in Swing (The Java™ Tutorials > Creating a GUI with JFC/Swing)
Trail: Creating a GUI with JFC/Swing
Home Page > Creating a GUI with JFC/Swing
Questions and Exercises: Concurrency in Swing

Questions

  1. For each of the following tasks, specify which thread it should be executed in and why.
  2. One set of threads is not used for any of the tasks mentioned in the previous question. Name this thread and explain why its applications are so limited.
  3. SwingWorker has two type parameters. Explain how these type parameters are used, and why it often doesn't matter what they are.

Exercises

  1. Modify the Flipper example so that it pauses 5 seconds between "coin flips." If the user clicks the "Cancel", the coin-flipping loop terminates immediately.
Check your answers.
Previous page: Bound Properties and Status Methods
Next page: Using Other Swing Features