Java Draw String drawStringRight(final Graphics g, final FontMetrics m, final String str, final int x, final int y)

Here you can find the source of drawStringRight(final Graphics g, final FontMetrics m, final String str, final int x, final int y)

Description

draw String Right

License

Open Source License

Declaration

public static void drawStringRight(final Graphics g, final FontMetrics m, final String str, final int x,
            final int y) 

Method Source Code


//package com.java2s;
import java.awt.FontMetrics;
import java.awt.Graphics;

public class Main {
    public static void drawStringRight(final Graphics g, final FontMetrics m, final String str, final int x,
            final int y) {
        g.drawString(str, x - m.stringWidth(str), y);
    }/*from   w w w. j av a 2  s .c  o  m*/
}

Related

  1. drawStringInBox(Graphics g, String string, int x, int y)
  2. drawStringLeft(Graphics2D g, String text, Rectangle rect, int fontHeight, Color c)
  3. drawStringOnImage(Image image, String string, int x, int y)
  4. drawStringOnScreen(String s, Color color, long milseconds)
  5. drawStringPair(Graphics2D g, String str1, String str2, int left, int right, int y, int size, Color color, boolean bold)
  6. drawStringRightAlignedVTop(Graphics graphics, String string, int x, int yTop)
  7. drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
  8. drawStringVCentered(Graphics graphics, String string, int x, int upperY, int lowerY)
  9. drawStringVertical(Graphics graphics, String string, int x, int y)