get Antialiasing Hints - Java 2D Graphics

Java examples for 2D Graphics:Graphics

Description

get Antialiasing Hints

Demo Code


//package com.java2s;

import java.awt.RenderingHints;

public class Main {
    protected static RenderingHints qualityHints = null;

    /**//w ww .j av  a2  s .c  o m
     *
     */
    public static RenderingHints getAntialiasingHints() {
        if (qualityHints == null) {
            qualityHints = new RenderingHints(
                    RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_ON);
            qualityHints.put(RenderingHints.KEY_RENDERING,
                    RenderingHints.VALUE_RENDER_QUALITY);
        }

        return qualityHints;
    }
}

Related Tutorials