ok im getting mad errors when i do this what is the correct way to do this?

Code:
intPieces = Integer.valueOf(txtPieces.getText().valueOf());