Search code examples
javastringresolutiongraphics2d

How to increase the quality strings drawn with Graphics2D?


After experimenting back and forth with Graphics2D vs. JPanels I have noticed that strings written on a JPanel are much higher resolution (less pixilated) then those drawn with g.drawString().

Is there any way to increase the resolution of strings drawn with Graphics2D?


Solution

  • When you draw using Graphics2D directly, are you using RenderingHints.KEY_TEXT_ANTIALIASING as mentioned here?