views:

57

answers:

2

I've written backend for simple Bantumi game. Now I'd like to create a simple GUI for it, so that it would look like this :

alt text

How to start ? What layout should I use, and what type of component each element should be? Classes :
Basket
Player
Game
Main
Shared

A: 

If you want it to be online game you can look at JavaScript canvas or Flash. Of course you can also create Java applet that uses something like combination of Swing and Java 2d

DroidIn.net
Based on the tags, I assume Java is the requirement already... I think the question is about which specific widgets to use.
bmoeskau
Sometimes people don't realize that Java can be used on the back but the actual drawing can be done entirely on the client (this particular game can probably be done entirely in JS) I'm just trying to generate some ideas
DroidIn.net
Based on the homework tag, I'm guessing there's not going to be much flexibility allowed.
Catchwa
+2  A: 

For the layout, I would suggest that you have an outer JPanel that used something like a BorderLayout. It would contain the two end baskets and in the cetner another JPanel that employs a GridLayout to hold all of the playing baskets.

As for the classes, it looks like your Main class is superfluous - you can just put the main method in your Game class and call that. The Shared class and the Player class do not need to be represented as GUI classes, so they can remain as is. I would suggest that you have your Basket method extend JPanel and override the paintComponent() method to allow for custom painting of the beans. You have a choice with Game, you could make it extend JFrame or have it contain a JFrame.

akf