Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

GUI issues


  • Please log in to reply
No replies to this topic

#1 sausage

sausage

  • Members
  • 390 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Colorado
  • Local time:02:01 PM

Posted 31 January 2009 - 08:25 PM

I am making a TicTacToe game for GUI practice. I need to know two things... one how to check for three in a row, two, how to get my buttons to not replace the symbol already in the spot.
I'm not sure exactly how to show the form itself on the forum but my action code for the button is this

private void Button13ActionPerformed(java.awt.event.ActionEvent evt) {
		place13.setText(turn);
		if(turn.equals("X"))
			turn = "O";
		else
			turn = "X";
		Turn.setText(turn+"'s Turn");
}

What I've got is 9 buttons arranged in a tic tac toe order and 9 text fields next to the buttons.

P.S. for those of you that care.... (no one) my sig doesn't work at the moment.

EDIT: After careful time of thinking (while watching south park) I figured it out... now I need something to do... something basic to practice action listeners

Edited by sausage, 01 February 2009 - 01:16 PM.


BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users