I am working on the extra credit for this assignment. I have code that can creat
ID: 3535468 • Letter: I
Question
I am working on the extra credit for this assignment. I have code that can create the top 8 boxes. Now I'm working to complete the extra credit. See the description below after the 8th dialogue box.
Here's the code:
// YourNameProg7.java
public class YourNameProg7 extends JFrame {
public YourNameProg7() {
//sets flowlayout to th frame
this.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(jlbColorNumber);
this.add(jtfColorName);
jtfColorName.addActionListener(new TextFieldHandler());
String st = "";
for (int i = 0; i < NUMBEROFCOLORS; i++) {
st += colors[i] + " ";
}
JOptionPane.showMessageDialog(this, "How good is your memory? Try to memorixe this color sequence: " + st, "Message", JOptionPane.INFORMATION_MESSAGE);
}
//Inner Class for the TextField's ActionListener Event
private class TextFieldHandler implements ActionListener{
Explanation / Answer
Working...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.