General

Tech

Java Hangman Game

Hey. I'm currently taking comp sci 1-2 at my school and my teacher assigned us to create a game using graphics but he barely taught us anything. He already left for a meeting and we have to email him our code. However, I hardly know anything about java graphics and am having trouble making a Hangman game. If anyone is experienced in java and could help me, that would really be appreciated. Message me or post here. I have aim and msn.

Current problem:
[quote=java]
/**
fail java docs...
i'm trying to get this method to check if the letter guessed is contained in the Winning Hangman word.
(i have this part working) then how do i draw a head / body / arm / leg
if the letter guessed is not contained within the winning word (String)
public void actionPerformed(ActionEvent e)
{
if(word.contains(valueField.getText()))
{
lettersLeft.setText(lettersLeft.getText() + valueField.getText());
}
else
{
lettersLeft.setText(lettersLeft.getText() + valueField.getText());
}
}
[/quote]

How do I get a head / body / arm / leg to draw if the letter they have guessed is wrong.

anyways, message me for my aim / msn if you could help me. thanks

June 4, 2011

1 Comment • Newest first

BanditZ1234

when i have the method as paintComponent it gives me an error, but it works fine as just
public void paintComponent(Graphics g){
super.paint(g);

this shouldn't be a problem right?

Reply June 4, 2011 - edited