title: How to draw a Round rectangle in java with normal rectangle outline
body: <p>For my java application i need a Round rectangle with an outline that looks like a normal rectangle, like this</p>
  
  <p><img src="https://i.stack.imgur.com/v7CDE.png" alt="enter image description here"></p>
  
  <p>I know you can do that by drawing a normal rectangle and a RoundRect inside it but i don't want to draw a RoundRect inside it because I want to draw something else in it.</p>
  
  <p>So a round rect with normal corners. How do I draw that in Java?</p>
  
  <p>The problem is that the rectangle looks like this if I use layers:
  <img src="https://i.stack.imgur.com/Mt3Lw.png" alt="enter image description here">The corners are filled up with the wrong color. How do I prevent that?</p>