CSC420: Homework 1


This is a very simple application to get you started with Swing. It requires placing two components in a frame and making one react to changes in the other. It also requires you to know how to load and display images.

Build a Java Swing application that allows users to select a European country's name out of a list, and then displays its flag in another panel.

You should use a JFrame, split in two parts (use whatever Swing components and layouts you think are feasible for that; do not use a JSplitPane, however, as that makes the task too easy). Both parts should be visible on the screen. The first part should contain a single-selection component, such as a drop-down list, or a radio button group. Populate that component with the names of European countries. The second part should contain room for an image. Whenever the user selects a country's name in the first half, your application should display that country's flag in the second one.

Submit your sources and resources (all your .java files in the correct directory structure, as well as the images you use in the proper place within the directory structure) to the dropbox before the deadline.

I'll want you to demonstrate how your homework works after you submit it, too.

All Swing homeworks are individual. Group work is not permitted.