Jogo da Forca com Java Swing
Jogo da Forca com Java Swing
package interfacesGUI;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Collections;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
/**
*
* @author Kleython Lacerda
*/
public class JogoPrincipal extends javax.swing.JFrame {
public JogoPrincipal() {
initComponents();
inicializar();
}
Collections.shuffle(palavras);
botoes.add(jBtnA);
botoes.add(jBtnB);
botoes.add(jBtnC);
botoes.add(jBtnD);
botoes.add(jBtnE);
botoes.add(jBtnF);
botoes.add(jBtnG);
botoes.add(jBtnH);
botoes.add(jBtnI);
botoes.add(jBtnJ);
botoes.add(jBtnK);
botoes.add(jBtnL);
botoes.add(jBtnM);
botoes.add(jBtnN);
botoes.add(jBtnO);
botoes.add(jBtnP);
botoes.add(jBtnQ);
botoes.add(jBtnR);
botoes.add(jBtnS);
botoes.add(jBtnT);
botoes.add(jBtnU);
botoes.add(jBtnV);
botoes.add(jBtnW);
botoes.add(jBtnX);
botoes.add(jBtnY);
botoes.add(jBtnZ);
this.erro = 0;
this.contagem = 0;
jLbPontuacao.setText(String.valueOf(this.pontuacao));
this.palavra = this.palavras.get(0);
this.resultado = new String[palavra.length()];
this.palavras.remove(0);
jLbForca.setIcon(f0);
jLbPalavra.setText("");
b.setEnabled(false);
jLbPalavra.setText("");
@SuppressWarnings("unchecked")
………..