Please help i have added buttons but they aren't how i want them.....how do i change the letters to squares and how i want them? and at the very bottom i am confused with what to do next thanks for anyhelp
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.JOptionPane;
public class MyHangman extends Applet {
private boolean usd[] = new boolean[26];
private String guess;
private int numguesses = 0;
private boolean finished = false;
private boolean won = false;
private Button b[];
char secretWord[];
public void init() {
int a;
StringBuffer buff = new StringBuffer();
setLayout ( new GridLayout(83,1));
b = new Button[26];
for(a = 0; a < 26; a++)
{
buff = new StringBuffer();
buff.append((char)(a+65));
b[a] = new Button(buff.toString());
//b[a].addActionListener(this);}
add(b[a]);//adds all of the buttons
//guess = getParameter("wrd").toUpperCase();
}
}
StringBuffer wrong = new StringBuffer();
for (int l = 0; l<=25; l++) {
if (usd[l]) wrong.append((char)(l+65));
else wrong.append(".");
}
g.setColor(Color.green);//Setting up the incorrect guessed letters
Font f = new Font("Palatino",Font.BOLD+Font.ITALIC,65);
g.setFont(f);
g.drawString(wrong.toString(),300,850);//end of writing the wrong letters
StringBuffer right = new StringBuffer();
Font ff = new Font("Palatino",Font.BOLD,85);
g.setColor(Color.black);
g.setFont(ff);
for (int ii = 0; ii < guess.length(); ii++)
if(usd[(int)guess.charAt(ii)-65])
right.append(guess.charAt(ii));//Marks down the right answers
else
right.append("."); //If the same letter is used twice it won't be put down
//or counted
g.drawString(right.toString(),600,400);