List of usage examples for java.awt RenderingHints VALUE_ANTIALIAS_ON
Object VALUE_ANTIALIAS_ON
To view the source code for java.awt RenderingHints VALUE_ANTIALIAS_ON.
Click Source Link
From source file:Text.java
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); rh.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2d.setRenderingHints(rh);/*from ww w .j a v a2 s . co m*/ Font font = new Font("New Roma", Font.BOLD, 40); g2d.setFont(font); g2d.drawString("text", 20, 30); }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Font font = new Font("Serif", Font.PLAIN, 40); AttributedString as1 = new AttributedString("1234567890"); as1.addAttribute(TextAttribute.FONT, font); g2d.drawString(as1.getIterator(), 15, 60); }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); String s = "www.java2s.com"; Font font = new Font("Serif", Font.PLAIN, 24); FontRenderContext frc = g2.getFontRenderContext(); GlyphVector gv = font.createGlyphVector(frc, s); g2.drawGlyphVector(gv, 40, 60);/*from w w w . j av a2 s. c om*/ }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setPaint(Color.black);/*from www . j av a2 s . c o m*/ g2.draw(new Rectangle2D.Float(10, 20, 30, 40)); AffineTransform at = AffineTransform.getTranslateInstance(75, 75); g2.transform(at); g2.setPaint(Color.red); g2.draw(new Rectangle2D.Float(10, 20, 30, 40)); }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setPaint(Color.black);/*from w ww .j a v a2 s .c o m*/ g2.draw(new Rectangle2D.Float(10, 20, 30, 40)); AffineTransform at = AffineTransform.getTranslateInstance(75, 75); g2.setTransform(at); g2.setPaint(Color.red); g2.draw(new Rectangle2D.Float(10, 20, 30, 40)); }
From source file:SimpleFont.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); String s = "Java Source and Support"; Font font = new Font("Serif", Font.PLAIN, 24); FontRenderContext frc = g2.getFontRenderContext(); GlyphVector gv = font.createGlyphVector(frc, s); g2.drawGlyphVector(gv, 40, 60);/*from w ww . j a v a 2s . c o m*/ }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; RenderingHints rh = g2.getRenderingHints(); rh.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHints(rh);//from w w w . j a v a 2 s.c om BasicStroke bs = new BasicStroke(36.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL); g2.setStroke(bs); GeneralPath path = new GeneralPath(); path.moveTo(30.0f, 90.0f); path.lineTo(150.0f, 20.0f); path.lineTo(270.0f, 90.0f); g2.draw(path); }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; RenderingHints rh = g2.getRenderingHints(); rh.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHints(rh);/* www .ja va 2s.c om*/ BasicStroke bs = new BasicStroke(36.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER); g2.setStroke(bs); GeneralPath path = new GeneralPath(); path.moveTo(30.0f, 90.0f); path.lineTo(150.0f, 20.0f); path.lineTo(270.0f, 90.0f); g2.draw(path); }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; RenderingHints rh = g2.getRenderingHints(); rh.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHints(rh);/*from ww w. java2 s.co m*/ BasicStroke bs = new BasicStroke(36.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND); g2.setStroke(bs); GeneralPath path = new GeneralPath(); path.moveTo(30.0f, 90.0f); path.lineTo(150.0f, 20.0f); path.lineTo(270.0f, 90.0f); g2.draw(path); }
From source file:PrintLineByLine.java
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); rh.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2d.setRenderingHints(rh);/*www .j av a 2 s .co m*/ g2d.setFont(new Font("Purisa", Font.PLAIN, 13)); g2d.drawString("Line 1", 20, 30); g2d.drawString("Line 2", 20, 60); g2d.drawString("Line 3", 20, 90); g2d.drawString("Line 4", 20, 120); g2d.drawString("Line 5", 20, 150); g2d.drawString("Line 6", 20, 180); }