Text Field Width

Is there a way to set the width of a text field equal to the width of the text in it?