Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: CyberPet Project - Using Java and GUI (NO APPLETS)

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy CyberPet Project - Using Java and GUI (NO APPLETS)

    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.

    Free File Hosting Made Simple - MediaFire

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

    How to Use Combo Boxes (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)

    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.
    Free File Hosting Made Simple - MediaFire


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default Re: CyberPet Project - Using Java and GUI (NO APPLETS)

    Hello Princess90.

    The Members Introduction forum is not the best place to post this thread.

    Have you attempted any of this assignment yet?

    No one here will do this assignment for you. We are not a homework service.
    Please attempt to start this assignment yourself. Let us know where you are stuck and we can help you move forward.

    If you show an effort, our members will be more than happy to help.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

Similar Threads

  1. Help With Applets
    By mukilan in forum AWT / Java Swing
    Replies: 12
    Last Post: February 2nd, 2011, 10:18 PM
  2. Drawing in applets. Tell me why this way is wrong.
    By Asido in forum Java Theory & Questions
    Replies: 9
    Last Post: August 1st, 2010, 01:55 PM
  3. Applets
    By santiagomez in forum Java Theory & Questions
    Replies: 2
    Last Post: July 31st, 2010, 04:05 PM
  4. Help needed with applets
    By Brt93yoda in forum What's Wrong With My Code?
    Replies: 16
    Last Post: July 12th, 2010, 07:36 PM
  5. Learn applets in java
    By mohsendeveloper in forum Java Applets
    Replies: 2
    Last Post: June 25th, 2009, 02:50 PM