awt中的RenderingHints使用备忘

1、开启抗锯齿
public void paintComponent(Graphics g) {		
			super.paintComponents(g);
			Graphics2D g2d = (Graphics2D) g;
			HashMap<Object, Object> renderingHintsMap=new HashMap<Object, Object>();
			renderingHintsMap.put(RenderingHints.KEY_ANTIALIASING , RenderingHints.VALUE_ANTIALIAS_ON);
			g2d.addRenderingHints(renderingHintsMap);
...
}

你可能感兴趣的:(java)