Java Font Text Width stringWidth(Graphics2D g, String s)

Here you can find the source of stringWidth(Graphics2D g, String s)

Description

string Width

License

Open Source License

Declaration

public static int stringWidth(Graphics2D g, String s) 

Method Source Code


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

import java.awt.Graphics2D;

public class Main {
    public static int stringWidth(Graphics2D g, String s) {
        return g.getFontMetrics().stringWidth(s);
    }//from   ww  w.  j  a v  a2 s  .c o  m
}

Related

  1. setFixedWidthFont(Component comp)
  2. shrinkFontForWidth(Font base, String text, int desiredWidth, Graphics getMetrics)
  3. stringPixelWidth(String text, FontMetrics fm)
  4. stringWidth(final FontMetrics fm, final String string)
  5. stringWidth(Graphics g, String s)
  6. stringWidth(java.awt.Font font, String string)
  7. stringWidth(String text, Font font)
  8. wrap(String str, FontMetrics fm, int maxWidth)
  9. wrapLineInto(String line, List list, FontMetrics fm, int maxWidth)