Top Posters
Since Sunday
g
3
3
2
J
2
p
2
m
2
h
2
s
2
r
2
d
2
l
2
a
2
New Topic  
Oughto Oughto
wrote...
Posts: 742
Rep: 1 0
7 years ago
Look at the following applet code.

1  import javax.swing.*;
2  import java.awt.*;
3  public class GraphicsTest extends JApplet
4  {
5    public void init()
6    {
7      getContentPane().setBackground(Color.WHITE);
8    }
9    public void paint(Graphics g)
10   {
11    int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12    int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13    super.paint(g);
14    g.setColor(Color.YELLOW);
15    g.fillPolygon(xCoords, yCoords, 8);
16    g.setColor(color.BLACK);
17    g.setFont(new Font("SansSerif", Font.BOLD, 35));
18    g.drawString("SLOW", 35, 95);
19   }
20 }

How many vertices does the polygon have?
A) 6
B) 8
C) 7
D) 5
Textbook 
Starting Out with Java: Early Objects

Starting Out with Java: Early Objects


Edition: 4th
Author:
Read 183 times
3 Replies
Replies
Answer verified by a subject expert
ToothyToothy
wrote...
Top Poster
Posts: 744
Rep: 4 0
7 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

Oughto Author
wrote...
7 years ago
I mentioned in my previous post that I chose this as an elective, thanks for helping me understand
wrote...
7 years ago
Cheers dude
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1223 People Browsing
 116 Signed Up Today
Related Images
  
 39
  
 876
  
 620
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 352

Previous poll results: What's your favorite coffee beverage?