int width = fm.stringWidth("m") * tf.getColumns() + 1;
harness.check(tf.getBounds(), new Rectangle(0, 0, width, height));
// restore a sane look and feel
try
{
UIManager.setLookAndFeel(new MetalLookAndFeel());
}
catch (Exception e)
{
e.printStackTrace();
}