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 3 of 3

Thread: Creating new objects per key event

  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    38
    Thanks
    11
    Thanked 1 Time in 1 Post

    Default Creating new objects per key event

    Hey, I'm trying to make a basic Map Editor and was wondering how to create multiple image objects based on a key event. In the program right now, the player moves around. When they hit enter, an image is placed at those coordinates. When the player hits enter again, the image moves to where ever the player is. I was wondering how I could make an Image object per event so that the player will be able to place multiple images all over the frame.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Creating new objects per key event

    You'd do the same thing, only instead of drawing a single image, you'd have a List of images.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. The Following User Says Thank You to KevinWorkman For This Useful Post:

    sp11k3t3ht3rd (October 12th, 2011)

  4. #3
    Member
    Join Date
    Oct 2010
    Posts
    38
    Thanks
    11
    Thanked 1 Time in 1 Post

    Default Re: Creating new objects per key event

    Oh thanks! I never though of that. It works perfectly now!

Similar Threads

  1. Is it possible to use same event code for several objects?
    By stab in forum Object Oriented Programming
    Replies: 4
    Last Post: September 27th, 2011, 12:12 PM
  2. Triangles problem - creating triangle objects
    By sparky5783 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 15th, 2011, 12:38 PM
  3. Creating array from generic type objects?
    By AndrewMiller in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 13th, 2010, 09:22 PM
  4. Loop not creating objects
    By xecure in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 30th, 2010, 10:48 PM
  5. Object creation from a input file and storing in an Array list
    By LabX in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: May 14th, 2009, 03:52 AM