Presentation is loading. Please wait.

Presentation is loading. Please wait.

Agenda Warmup Prep for Core #1 Lesson G2 (RGB, Loops in Graphics)

Similar presentations


Presentation on theme: "Agenda Warmup Prep for Core #1 Lesson G2 (RGB, Loops in Graphics)"— Presentation transcript:

1 Agenda Warmup Prep for Core #1 Lesson G2 (RGB, Loops in Graphics) Independent Practice (G2 Assignments) Time Permitting: Lesson G3 (Applet Methods) Closure Activity Students will be able to: Understand how RGB colors work in Java Create a custom color using RGB values Use a loop to create multiple drawings in an applet Create multiple objects, then call their draw( ) methods See how today's lesson fits into the unit and the course as a whole

2 Warmup What is a nested loop? What is an accumulator?
What is an applet? What must you do with an applet in order to display it? Which important data are specified in an HTML document in JCreator? If a window in appletviewer is 400 x 600, what are the coordinates of the upper-right corner? What code would draw a square whose upper-left corner is at the upper-left corner of the appletviewer window, and whose area is 256 square pixels? In an ArrayList called x, what code would replace the 2nd element with an Object called y?

3 RGB use RGB (red, green, blue) to create a color other than one of the pre-defined colors. For each of the 3 colors, you must enter a number between 0 and 255. For example, pure red would have a red value of 255, and green and blue would have values of 0. EXAMPLE: page.setColor(new Color(5,240,100)); page.fillOval(4,4,90,90); // creates a circle that is mostly green, with // some blue and very little red. See RGBDemo

4 Using loops in graphics
For simple drawings, if you want to draw more than one, it is often most efficient to do so in a loop. Demo: Bullseye

5 Assignments (show examples)
P. 186 # 17 (use a loop, and page.drawLine) 2. P. 186 # 18 (use RGB values and a loop)


Download ppt "Agenda Warmup Prep for Core #1 Lesson G2 (RGB, Loops in Graphics)"

Similar presentations


Ads by Google