Java Draw String drawString(Graphics2D g, String string, double x, double y, Color color)

Here you can find the source of drawString(Graphics2D g, String string, double x, double y, Color color)

Description

draw String

License

Open Source License

Declaration

public static void drawString(Graphics2D g, String string, double x, double y, Color color) 

Method Source Code


//package com.java2s;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

public class Main {
    public static Font myFont = new Font("Dialog", Font.PLAIN, 16);

    public static void drawString(Graphics2D g, String string, double x, double y, Color color) {
        g.setColor(color);/*  w ww  .  j  a  v a2s.  c o  m*/
        g.setFont(myFont);
        g.drawString(string, (int) x, (int) y);
    }
}

Related

  1. drawString(Graphics g, String text, int underlinedChar, int x, int y)
  2. drawString(Graphics g, String text, int underlinedChar, int x, int y)
  3. drawString(Graphics g, String text, int x, int y)
  4. drawString(Graphics g2, String string, int x, int y, Font font, Color color)
  5. drawString(Graphics2D g, String s, int x, int y, int width)
  6. drawString(Graphics2D g, String string, int x, int y)
  7. drawString(Graphics2D g, String string, int x, int y, boolean includeOutline)
  8. drawString(Graphics2D g2, String str, int x, int y, int halign, int valign)
  9. drawString(Graphics2D gfx, String text, int x, int y)