So I have been working on this project for quite some time and I can't figure out why I keep getting an "Illegal Start of Expression" error. I tried moving the variables above the main method and that only returned the same error but instead of the error occuring at line 14, it occurs at the start of the next method(applet). Any help would be greatly appreciated! I'm sure it's just some stupid formatting error...
package superhangman;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
public abstract class SuperHangman extends Applet implements ActionListener {
public static void main(String[] args){
static final int LOSE = 5;
private int errors;
private String message;
private String information;
private String rword;
private StringBuffer gword;
private Button bReStart;
private Button bGo;
private TextField tfLetter;
private Font fnt;
public void applet() {
fnt = new Font("MonoSpaced", 0 ,12);
setFont(fnt);
tfLetter = new TextField();
bReStart = new Button("Restart");
bGo = new Button("Go");
add(bReStart);
add(bGo);
add(new Label("Guess a Letter"));
add(tfLetter);
bReStart.addActionListener(this);
bGo.addActionListener(this);
startgame();
}
Inline Code Example Here`