Well according to my opnion better practice will be making a textfield and a small beautiful button with it. Disable text field. When the user press the button the message box display and ask for data and display it in textfield...
And i think you need confirmation box , not the messagebox.
Instead of testing your JTextfield to see if it isEnabled(),
use a variable and track it yourself.
You can set it using Object.setEnabled(Variable); as indicated by Majestics.