Java Canvas and Graphics classes to create an example of a computer generated image

Example 1: Write a simple java swing application that will display rectangle graphics as shown in the picture below:

Color randomColor = Color.getHSBColor( (float)Math.random(), 1.0F, 1.0F );

Example 2: Write a simple java swing application that will display rectangle graphics as shown in the picture below:

public void repaint();

Example 3: Write a simple java swing application that will display rectangle graphics as shown in the picture below:

Color myColor = Color.getHSBColor(h,s,b);

Tags:

Java Example