Ok, so I\'m attempting to do an exercise from a book I\'m using to learn Java. Here is the code that I have so far:
import javax.swing.*;
import java.awt.Gri
JButton[] buttons = new JButton[10]
The line above is correct, but I see two points of confusion:
This line:
buttons[0] = "button0";
should instead be as follows:
buttons[0] = new JButton("button0");
The reason is that in your code, you're trying to assign a String to buttons[0], instead of the expected JButton.
Ok, so I tried declaring the array with the Buttons[] numbuttons line, but that just gave me the error: Multiple markers at this line -Buttons can not be resolved to a type -Buttons can not be resolved to a type
Buttons is not a standard Java class. Do a case-sensitive search
for Buttons and replace all matches with JButton.
If you still have problems, please copy and paste the exact code for each variation that is not working.