Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For the layout, I would suggest that you have an outer
JPanelthat used something like a BorderLayout. It would contain the two end baskets and in the cetner anotherJPanelthat employs aGridLayoutto hold all of the playing baskets.As for the classes, it looks like your
Mainclass is superfluous – you can just put themainmethod in yourGameclass and call that. TheSharedclass and thePlayerclass do not need to be represented as GUI classes, so they can remain as is. I would suggest that you have yourBasketmethod extendJPaneland override thepaintComponent()method to allow for custom painting of the beans. You have a choice withGame, you could make it extendJFrameor have it contain aJFrame.