I am creating a crossword puzzle program that displays the crossword through applet. I'm attempting to create a method that will allow the user to enter his/her desired word. I call this enterWord()
My issue comes in when I try to implement applet into it. I want my enterWord()
method to allow the user to put in their newWord
, the x coordinate and the y coordinate.
How can I change this code:
import java.awt.Graphics;
import java.applet.Applet;
public class crosswordMain extends Applet {
String word;
int wordlen;
public crosswordMain(){
}
public void enterWord(String newWord, int xCoordinate, int yCoordinate){
word = newWord;
public void paint(Graphics g){
g.drawString(newWord, xCoordinate, yCoordinate);
}
}
}
To make it work? The issue comes at the public void paint(Graphics g){
part.
Any help would be great! Thanks!