0

How would I draw a shape in an applet and have the border one color with the fill a different color?

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by kahaj
0

I figured this one out on my own. Thought I'd post the code in case someone searches something to this effect up in the future. Just have to put the line color first, then the fill color.

//square with a black border and red fill
        g.setColor(Color.black);
        g.drawRect(15, 15, 50, 50);
        g.setColor(Color.red);
        g.fillRect(16, 16, 49, 49);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.