his is my java assignment. I really need help with it.
It is basicallY a Cyber Pet program where in you make the use of a GUI. Here is the file that you can download the whole question from.
http://www.mediafire.com/?gfw9c16tubdlf
You gotta have 2 packages : One for the GUI and the other for the CyberPet. The GUI package contains the GUI code . In the GUI package, there are 2 GUI.
GUI1 is a normal interface where it asks the user to choose the pet he/she wants. The feature of naming the pet also includes in this.
You can refer to this link .. I want the GUI to be somethin like this ..
http://download.oracle.com/javase/tutorial/uiswing/components/combobox.html
Check out the combo box demo .. It should display the picture while selecting the choice of the pet.
GUI1 also has a button named "Enter".
When you click on ENTER , it takes you to another frame that has displays the picture of the pet in the centre.
The GUI2 should possess a “Hungry” button which when pressed causes the pet to move towards its prey in steps of fixed length, while the prey continues to move in a random fashion. It also prints a console message “The pet is hungry”.
When the prey is within a pre-determined distance from the pet, the pet ‘eats’ the prey as follows:
(i) the frog shoots out a long red tongue that touches the fly and then the tongue retracts. The fly disappears and is assumed to be eaten.
(ii) The cat moves on top of the mouse so that the mouse is no longer visible and the mouse is assumed to have been eaten.
A console message is printed “The pet is no longer hungry”
It will display something saying "Pet is not hungry anymore" in the console when it has finished eating the prey.
This is using the just one pet.
Additional feature: If possible, make another GUI named GUI3 wherein all the pets go behind their respective preys and eat them up.
No applets . Plain pure java code needed.
Any help will be appreciated. Thankyou so much
P.s : Assignment question can be downloaded here.
http://www.mediafire.com/?gfw9c16tubdlf