Java Draw String drawStringAtPoint(Graphics g, String s, Point p)

Here you can find the source of drawStringAtPoint(Graphics g, String s, Point p)

Description

Draws a String on the screen using a Point instead of x y

License

Open Source License

Parameter

Parameter Description
g The Graphics to draw with
s The String to draw
p The coordinates of the String

Declaration

public static void drawStringAtPoint(Graphics g, String s, Point p) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Graphics;
import java.awt.Point;

public class Main {
    /**//from   w w  w.j ava 2s . co  m
     * Draws a String on the screen using a Point instead of x y
     * @param g The Graphics to draw with
     * @param s The String to draw
     * @param p The coordinates of the String
     */
    public static void drawStringAtPoint(Graphics g, String s, Point p) {
        g.drawString(s, p.x, p.y);
    }
}

Related

  1. drawString(Image img, String text, Color color)
  2. drawString(String pString, Graphics2D pG, int pX, int pY, int pWidth, int pHeight, boolean pYOverflow, boolean pShrinkWords, String pJustification, boolean pDraw)
  3. drawString(String txt, int x, int y, Graphics g)
  4. drawStringAlignCenter(Graphics2D g2d, String s, int x, int y)
  5. drawStringAt(Graphics g, String t, int x, int y, int where)
  6. drawStringEx(Graphics g1, String s, Font font, Rectangle rect, int align, int valign)
  7. drawStringInBox(Graphics g, String string, int x, int y)
  8. drawStringLeft(Graphics2D g, String text, Rectangle rect, int fontHeight, Color c)
  9. drawStringOnImage(Image image, String string, int x, int y)