Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-16-2008, 04:45 PM   PM User | #1
chiefbutz
New Coder

 
Join Date: Mar 2005
Location: Indiana (USA)
Posts: 50
Thanks: 4
Thanked 0 Times in 0 Posts
chiefbutz is an unknown quantity at this point
Need a bit of logic help

I will say upfront that this is for a class I am taking. We initially had to make a chess program and have it use the command line. Now we know how to do GUIs and we must make it a GUI chess program. My difficulty lies with click events. I have my chess board lied out with JToggleButtons so you can click the piece you want to move, then where you want to move to. I am trying to figure out how I should setup the click events. This program must place checkers too, so I have a few abstract classes in the mix as well. I have a class that sets up the game board and is also an abstract class. Well I need to setup my click events when I do the board, so I initially made a separate class that when the click event was added I could add the x and y board coordinate to it, so it could use it. I then had planned to have the click event (ActionListener) call my chess game class to do the move things, then I thought about it and realized that would not work. I have been trying to come up with something, but I am having trouble. What I really need is a way to send commands to an instance of a class from an unrelated class. If someone could help me with a strategy that does that, or something I would be most grateful.
chiefbutz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:26 AM.


Advertisement
Log in to turn off these ads.