d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > I Seriously Need Help With Basic Java. > Please. I Have A Online Class .
Prev12
Add Reply New Topic New Poll
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 17 2016 09:18pm
you really shouldn't call it a square if it's not a square, imo.

Quote (nikkilina @ Sep 17 2016 10:48pm)
Okay I have another question.

g.setColor(gray);
Polygon square = new Polygon();
square.addPoint(120, 250);
square.addPoint(110, 550);
square.addPoint(285, 550);
square.addPoint(280, 250);
g.drawPolygon(square);

I am trying to fill this square in with gray. The issue is, I can't do a g.fillRect because this shape is slanted.

How do I fill this in with gray paint?


did you try out my previous suggestion?

Quote
it's probably as simple as replacing drawXXX with fillXXX
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll