For Programmers: Free Programming Magazines  


Home > Archive > Java Help > August 2005 > Help w/ MouseListener (MasterMind)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help w/ MouseListener (MasterMind)
Unknown

2005-08-31, 7:56 am

I am having trouble implementing MasterMind (the game). I designed a
class that adds to a JPanel multiple JComponents which each contain 4
circles. Upon clicking a circle, the program prints an appropriate colored
circle that the user has selected over the circle. The problem is that when
implementing it, I am only allowed to let the user to click on one row at a
time, starting with the first row. I've tried many things...should I
perhaps implement the MouseListener in a separate class rather than inside
the ...Is there an easy way to allow the user to click on one row at a time?


Eric Sosman

2005-08-31, 6:59 pm



Unknown wrote:
> I am having trouble implementing MasterMind (the game). I designed a
> class that adds to a JPanel multiple JComponents which each contain 4
> circles. Upon clicking a circle, the program prints an appropriate colored
> circle that the user has selected over the circle. The problem is that when
> implementing it, I am only allowed to let the user to click on one row at a
> time, starting with the first row. I've tried many things...should I
> perhaps implement the MouseListener in a separate class rather than inside
> the ...Is there an easy way to allow the user to click on one row at a time?


How about theComponent.setEnable(boolean)?

If that doesn't help, you'll probably need to show
actual code for what you're doing.

--
Eric.Sosman@sun.com

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com