Question: Write a program that draws the image shown in Figure 3G.39 onto a DrawingPanel of size 650 400. The image represents a famous optical

Write a program that draws the image shown in Figure 3G.39 onto a DrawingPanel of size 650 × 400. The image represents a famous optical illusion called the “Cafe Wall,” in which a series of straight squares appears to be slanted.

Drawing Panel 区

The image has a gray background and many rows of black and white squares with a blue X drawn through each black square. The two freestanding rows in the diagram have the following properties:

Table 3G.8 Cafe Wall Row Properties

The diagram has four grids of rows of squares, with 2 pixels of vertical space between adjacent rows. A key aspect of the optical illusion is that every other row is shifted horizontally by a particular offset. The four grids have the following properties:

Table 3G.9 Cafe Wall Grid Properties

Drawing Panel

Step by Step Solution

3.33 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javaawtColor import javaawtGraphics public class CafeWall static int posx 50 static int posy 70 static int pairs 5 static int bsize 30 static i... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!