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: Help with a program to make a landscape picture

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Help with a program to make a landscape picture

    does anyone know the code that would make a random landscape with a black rectangle background 600 pixels wide by 400 pixels tall. with randomly placed, random sized and randomly colored rectangles aligned on the bottom of the black rectangle.

    If you have the code please post it here. it would be very much appreciated. thanks.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Help with a program to make a landscape picture

    See the following tutorial:
    Lesson: Working with Images (The Java™ Tutorials > 2D Graphics)
    You'll need to create an Image (see Creating and Drawing to an Image), get its graphics, and draw to it, using something like Math.random() to generate random sizes and colors.

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

    noseeds (December 16th, 2009)

Similar Threads

  1. Modify Colors in a Picture
    By theuniverse in forum Java Theory & Questions
    Replies: 0
    Last Post: October 17th, 2009, 04:49 PM
  2. Need help with a Picture!
    By Scout in forum Java Theory & Questions
    Replies: 1
    Last Post: October 12th, 2009, 05:33 PM
  3. How to make user press enter to continue in program?
    By BC2210 in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: October 3rd, 2009, 05:08 AM
  4. Replies: 9
    Last Post: June 27th, 2009, 04:05 PM
  5. Java program to write game
    By GrosslyMisinformed in forum Paid Java Projects
    Replies: 3
    Last Post: January 27th, 2009, 03:33 PM