Here you can find the source of drawString(Graphics2D g, String string, double x, double y, Color color)
public static void drawString(Graphics2D g, String string, double x, double y, Color color)
//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); } }