Maximum Aardvark

« A Look Back | Egad! It's Me! »

Deja Vu

As a preamble, I'd like to refer to this entry from my old diary at k5.

So Dan and I decided to revisit the bastard for our CS 349 final project because all of the game logic was already in place; all we had to do was give it a graphical frontend. What could be easier, right?

I trust you can see where this is going.

We began work in earnest in the middle of last week, slowly converting the various classes to versions that would work with a Swing frontend, making it more Object-Oriented, showing off our mad sprite animation skills. We cruised, more or less, every time that we worked on it. We put it away on Friday morning for the weekend, safe in the knowledge that we'd gotten a solid head start and that it would probably be finished by Sunday night.

You should be able, by now, to see where I am going with this.

Our first major problem cropped up when we realized that we needed our Game object to get the ante amount from a JPanel that sits in the main frame of the game. What pattern to use: observer? How? OK, so we'll have to use threads or something...erm, how? OK, let's put the JPanel in another frame. Wait, we still have to tell the game. Does the game listen to the JPanel? Should the JPanel listen to the Game? What are we doing?!

But wait, there's more.

We made it work. It's kludgy, and still doesn't seem like the Right Way to Do It, but it works. Few threads here, an observer pattern there, and we were back on track. We coasted for awhile.

Are you blind? Can you still not see where I am going with this?

We're stuck. On some sort of impossibly difficult situation involving the changing of a JPanel's background color. No, I am not kidding. setBackground(Color.YELLOW) doesn't work. setOpaque(true); setBackground(Color.YELLOW) doesn't work. setForeground(Color.YELLOW) doens't even work. Even weirder, we don't seem to be able to change the text of a JLabel contained in the offending JPanel once it has been instantiated and displayed.

So, our project isn't done. No more work will be done on it tonight, or likely tomorrow morning, as we have two exams tomorrow for which studying is required. With a little luck, fresh minds tomorrow night will bring us nearer to completion.