>>434
JTextField jt = new JTextField("aaaaaa");
Font f = jt.getFont();
FontMetrics fm = jt.getFontMetrics(f);
int sw = fm.stringWidth(jt.getText());