Graphics2D anti-alias

X

xx

Hi everyone:

Does anyone know how Graphics2D's anti-alias is implemented? Is that
possible to get some code?

Thank,

xx
 
C

Chris Lamprecht

This code usually goes in your paint or paintComponent method:

Graphics2D g2 = (Graphics2D) g.create();
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
// then continue painting as you would
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top