Saturday, November 29, 2008

Task: An exercise with Swing

Add a Swing GUI to task 8. The GUI should provide a means for the user to choose all the files they want to parse. We will print the word count as well as the line count of all the chosen files. So the user no longer needs to specify that.

The output should be printed in a read-only scrollable JTextArea on the GUI.

The design of the GUI is left as an exercise to the developer.

Coding Requirement:
Be sure that initialization of the GUI happens on the Event Dispatch Thread (EDT). Understand why it must happen on the EDT (what is the EDT?). At the moment you do not need to write any test code for the GUI.

Display a title for the application in the titlebar.

Be sure to print the debug log to the console as your program executes.

Some Thoughts:
Even though we are not testing the GUI, it is also part of the software we are building, and must be tested. Think about how you can test the GUI. We will work on this in the next exercise.

Describe what you did, any problems that you may have faced and how you overcame them, in a blog post.

Leave a comment here after completing this task.

Resources:
  1. The Swing Single Thread Rule - Cay Horstman
  2. Threads and Swing

No comments: