When drawing various things using a Graphics2D object and BasicStroke at 1.0f, I can't seem to get the g2d object to honor my RenderingHints settings. Specifically the *KEY_ANTIALIASING* set to *VALUE_ANTIALIAS_ON*.
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.setStroke(new BasicStroke(1.0f));
g2d.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON
);
// draw stuff...
}
Are there other keys I should be using? Am I not applying the keys in the appropriate place? Using it the way described above results in normal, pixelated shapes being drawn.