Skip Top Navigation Bar

Winter Scene with Java FX Mini-Lab

In this project we will be decorating our houses for winter (or whatever season / holiday you choose). It doesn't have to be your house, it can be any house.

You will want to use methods with parameters in this program. See, if you wanted to draw one pumpkin, you’d probably want to draw a few pumpkins. By including parameters, you can “stamp” out several pumpkins in different locations and different sizes. Maybe even different colors depending on your parameter list.

While this example is centered around a winter scene, you can use this idea for any season. Let your creativity guide you on this one..

Required Knowledge

In this lab, you will write program code to use the following topics:

Mission

This Winter scene example, uses a drawSnowflake method with a loop to create 50 snowflakes at different locations and sizes. It uses Math.random() to help determine the locations and the size of the snowflakes.

A house with snowflakes

Here is the code used to create this winter scene:

Now add your own methods. Some ideas: snowmen, sleds, mittens, lights, etc. Whatever they think a winter scene (or whatever season) should contain.