How to get TextField with a button attached to it??

Depends on what you want to do with the Button.

You might want to look at CustomField and wrap the TextField and Button in a HorizontalLayout/VerticalLayout in the initContent() method.