QuestionSet.java the line
public final String[] anspublic static final String[] ans.
The correct answer for $250,000 question (which package does
ActionListener belongs to ?) is java.awt.event.
But I will still use my wrong answer(java.awt) as the correct answer.
Don't make any change to the quesitions and answers in my
QuestionSet.java file.
Hints
Got the hints for
MoneyLabels.java,
Millonaire.java.
More hints
All the following will be discussed on 11/8 TA sections.
- The MoneyLabels use BorderLayout, not GridLayout
- use panel.setPreferredSize(new Dimension(width, height)) to set the
preferred width and height of components.
- button.setEnabled(false) used to disable button.
-
label.setText("<html><h1>string1</h1>
<h1>string2</h1></html>") display 2 big strings :
string1, string2 on 2 lines

We will write a game similar to the popular TV show
"Who wants to be a millionaire?"
You can go to millionaire. to play their game and read the rules.
Our homework will be a simplified version of it. We don't have 3 lifelines.
download the program
Here is the steps to download my program and execute it
- Download the program here .
- Download the picture at the top and save it in a folder name
images.
- Use dos commnad prompt and change to the folder to where
the mil.jar located.
-
Use
dir *.jar to make sure that the jar file is in the
folder. If not, save it again.
- use
cd foldername to change the folder
- execute the program by
java -cp mil.jar mil.Main .

To do your homework, this java file may be helpful to you :
QuestionSet.java .
And you can modify this program anyway you like.
You should also download the picture at the top of this page and
save it to the same folder (not in images folder).
This is going to be a huge program (about few hundred lines). My suggestion is
to break it into 2 more part :
-
Millionaire.java : extends JFrame, contains the main program.
-
MoneyLabels.java : extends JPanel, Contains the labels to show the money.
If you don't like the way I divide the programs, you can leave the program file
blank like
public class MoneyLabels {
// empty
}
If you need more classes (I don't recommend though), you can put the class
in Millionaire.java like this
public class Millionaire {
// you code
}
class ExtraClass {
// your code
}
You program should run similar to my program. You can change the color
of the label, fonts but you can't use the default color of the labels and
buttons.
Files you should submit
Millionaire.java, MoneyLabels.java, QuestionSet.java, mill.jpg
All source code submitted must contain the following information at the beginning of each file:
* Your full name.
* Your student ID number.
* Your PIC login ID.
* Your e-mail address.
* Your discussion section number and TA's name.
* The assignment number and description.
* Honesty pledge.
Properly formatted, this information should appear as follows:
/*
* Name: Charles Li
* Student ID: 000 000 000
* PIC ID: ccli
* E-mail: ccli@math.ucla.edu
* Discussion: 1A, Mike Moore
* Assignment: hw2
*
* I, Charles Li, pledge that this is my own independent work, which
* conforms to the guidelines of academic honesty as described in the course
* syllabus.
*
*/