Wikipedia contains an article
for each year – e.g. 1953 – with a variety of significant events,
birthdays, etc. If you go to
Wikipedia and type any year, you’ll see the article.
You can COPY all the events
and save them in a TEXT file – use a text editor like Notepad or
Scite. You will need to clean up a
few little details. Then your text
file should look something like this:
June
16 - Soviet Union and Yugoslavia form diplomatic relations.
June
17 - Workers Uprising: In East Germany, the Soviet Union orders a division of
troops…
June
18 - Egypt declares a republic.
June
19 - Execution of Julius and Ethel Rosenberg.
June
21 - Birth of Benazir Bhutto
June
30 - The first Chevrolet Corvette is built at Flint (Michigan).
July
4 - Strikes and riots in coal mining regions in Poland
July
5 - First meeting of the assembly of the European Economic Community in
Strasbourg, France.
July
10 - Soviet official paper Pravda announces that Lavrenti Beria has been
deposed from …
July
26 - Fidel Castro and his brother lead a disastrous assault on the Moncada
Barracks…
Now you can write a Java
program to open the file, read each line, and SEARCH for something. For example, you might want to search
for “Germany” to see if there were any significant events in Germany in
1953. Here is a program that does
this:
The program inputs a word (Germany) to search for and the name of a file (1953.txt). Then it prints out the matching events, like this:

This basic concept leads to a small project, described below.
== List Box ==
For #5, you are supposed to make a List box containing the names of the months.
Here
is a sample program demonstrating how to do this.
|
import java.awt.*; public class ListSample extends EasyApp List months = addList("Jan|Feb|Mar|Apr",50,50,100,300,this); Button num = addButton("Num",10,100,40,30,this); public void actions(Object
source, String command) |