6 changed files with 22 additions and 23 deletions
@ -1,13 +1,13 @@ |
|||
package wiki.tall.ccmq.common.util; |
|||
|
|||
import sun.font.FontDesignMetrics; |
|||
|
|||
import java.awt.*; |
|||
|
|||
public class ImgUtil { |
|||
public static int getStringWidth(String text,Font f){ |
|||
FontMetrics fm = FontDesignMetrics.getMetrics(f); |
|||
int w = fm.stringWidth(text); |
|||
return w; |
|||
} |
|||
} |
|||
//package wiki.tall.ccmq.common.util;
|
|||
//
|
|||
//import sun.font.FontDesignMetrics;
|
|||
//
|
|||
//import java.awt.*;
|
|||
//
|
|||
//public class ImgUtil {
|
|||
// public static int getStringWidth(String text,Font f){
|
|||
// FontMetrics fm = FontDesignMetrics.getMetrics(f);
|
|||
// int w = fm.stringWidth(text);
|
|||
// return w;
|
|||
// }
|
|||
//}
|
|||
|
Loading…
Reference in new issue