java计算字符串的宽度和高度

//g对象为一个Graphics
FontMetrics fm = g.getFontMetrics ();          
int strWidth = fm.stringWidth ("Registering plug-ins……");          
int strHeight = fm.getHeight ();  

 

转载:http://sbje5201314.blog.163.com/blog/static/280338620086332426488/

posted @ 2014-12-11 14:34  烟花易冷丶人心易凉  阅读(841)  评论(0编辑  收藏  举报