//g对象为一个GraphicsFontMetrics fm = g.getFontMetrics (); int strWidth = fm.stringWidth ("Registering plug-ins……"); int strHeight = fm.getHeight ();
转载:http://sbje5201314.blog.163.com/blog/static/280338620086332426488/