1

I'm developing a JApplet in which the user can draw some lines over an image. Lines can be red or green, but I need to highlight them because I don't know the background color.

So I thought that I can draw a white "border" to the line, and I tried to do this creating other two white lines to the left and to the rigth of the original one. But the result is poor.

Is there a better way to accomplish this goal?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Marco Fedele
  • 2,090
  • 2
  • 25
  • 45

1 Answers1

3

As mentioned by @Jesper, draw the line first using a thicker Stroke (as seen in this answer).

The black outline on the letters has width 2.

g.setStroke(new BasicStroke(2f));
Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433