Java examples for 2D Graphics:Graphics
enable Anti Aliasing
//package com.java2s; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; public class Main { public static void enableAntiAliasing(Graphics g) { ((Graphics2D) g).setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); }/* www . j a va 2 s . co m*/ }