RenderingHints.VALUE_ANTIALIAS_OFF : RenderingHints « java.awt « Java by API






RenderingHints.VALUE_ANTIALIAS_OFF

  


import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JComponent;
import javax.swing.JFrame;

public class BasicDraw {
  public static void main(String[] args) {
    new BasicDraw();
  }

  BasicDraw() {
    JFrame frame = new JFrame();

    frame.add(new MyComponent());

    frame.setSize(300, 300);
    frame.setVisible(true);
  }

}

class MyComponent extends JComponent {

  public void paint(Graphics g) {
    Graphics2D g2d = (Graphics2D) g;
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
  }
}

   
    
  








Related examples in the same category

1.RenderingHints.KEY_ANTIALIASING
2.RenderingHints.VALUE_ANTIALIAS_ON
3.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR
4.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB
5.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VBGR
6.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VRGB
7.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
8.RenderingHints.VALUE_TEXT_ANTIALIAS_ON
9.RenderingHints: containsValue(Object value)