Shapes: How to Outline with Thick Borders?
The program I am currently writing allows users to "select" objects that bounce around the screen. When an object is selected, the program draws a border around it so that the user can know that it is selected. However, the method I currently use to draw the outline, Graphics's drawOval() method, only draws a single pixel border, and this border is often not think enough to distinguish from the actual shape it is meant to outline.
Does anyone know of a way to draw a think border around a shape?
Re: Shapes: How to Outline with Thick Borders?
Set the Graphics Stroke....(or change the color).
For instance:
Code :
Stroke previousStroke = g.getStroke();
g.setStroke(new BasicStroke(2.0f));//2 pixel width
g.drawOval(...)
g.setStroke(previousStroke);
...assuming g is a Graphics2D instance
Re: Shapes: How to Outline with Thick Borders?
Ah! I knew there had to be a simple way to do it!
Okay, thank you very much!