• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a filled in Shape using Line2D class

 
Lisa Bergeron
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to create a JFrame and a JPanel then a geometric shape, however, the next problem has me stumped. I read the API specs on the Line2D class which has only confused me further. Can anyone direct me on how to approach the following problem?:
Use a loop to create a filled area. The loop variables will be used by a Line2D Class.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12100
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm not sure what you're trying to do exactly, but might you want to have a loop that draws a bunch of lines right next to each other to make a filled shape?
i.e. draw one line from (1,1) to (1,10),
then a line from (2,1) to (2,10)
then (3,1) to (3,10)
...
(10,1) to (10,10)
i think would give you a filled square from (1,1) to (10,10)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic