G’day, I have JPanel with some Line2D objects on it. Issue is when I draw this line it doesn’t appear as I want them to. Lines are not smooth, It’s hard to explain in word so I am posting an Image,

Zoomed Area,

How to make them look more polished rather than wrinkly.
Thanks
The problem is likely that you don’t have antialiasing turned on your Graphics context. Try the following line before you draw:
(where, of course,
graphicsis your Graphics2D instance).Later on when you discover that the text you’re drawing is also ugly and jagged, you’ll want to use
However, text is a little more complicated; there’s several values for this hint that you can use depending on (among other things) the type of screen you’re drawing the text to. You should read the
RenderingHints.KEY_TEXT_ANTIALIASINGAPI doc for those details.