Create a method that draws bars across the current picture using thick lines.

What will be an ideal response?


```
public void drawBars ( Color c o l o r , f loat width ,
int dist )
{
// g e t the Graphics2D o b j e c t
Graphics g r aphi c s = this . ge tGraphi c s ( ) ;
Graphics2D g2 = (Graphics2D) g r aphi c s ;
// s e t the c o l o r and brush width
g2 . s e tPa int ( c o l o r ) ;
g2 . s e tSt r o k e (new Bas i cSt roke ( width ) ) ;
// loop drawing h o r i z o n t a l l i n e s
for ( int x = d i s t ; x < this . getWidth ( ) ;
x = x + d i s t )
{
// draw the l i n e s
g2 . draw(new Line2D . Double (x , 0 ,
x , this . ge tHe ight ( ) ยก 1 ) ) ;
}
}
```

Computer Science & Information Technology

You might also like to view...

Left Arrow is an example of a Crop to Shape option in the Shape gallery

Indicate whether the statement is true or false

Computer Science & Information Technology

The _____________ value causes the resource cost to be driven by the number of resource units that have been assigned to the task multiplied by the unit cost of the resource.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A(n) ____ packet (unique to IPv6) contains a destination address that is associated with multiple interfaces, usually on different nodes.

A. multicast B. unicast C. broadcast D. anycast

Computer Science & Information Technology

Conditions in the computing environment changed dramatically in the late 1960s due to the development of ________ and integrated circuits.

A. parallel CPUs B. dedicated GPUs C. transistors D. silicon chips

Computer Science & Information Technology