• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Need help with my Java assignment from the start- to be submitted in a week.  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This 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.


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 ..


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.

Posts: 21745
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are NotACodeMill. Could you tell us what you've done already, and where you're stuck? We will then gladly point you in the right direction.
Let's go to the waterfront with this tiny ad:
how do I do my own kindle-like thing - without amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!