Posted By:
Robert_Lybarger
Posted On:
Wednesday, November 5, 2008 07:31 PM
the setText("string here") method is the correct way to put something into a text field object. If it isn't working, then you have something [else] going wrong.
Unrelated design criticism, but don't change the label of a button, as it can cause layout or other rendering issues, some of which depend on the layout manager being used. Especially when the label changes the meaning of the button and thereby changes the event processing that occurs downstream. Instead, create two buttons and put them both into a panel with a CardLayout, and then show the appropriate card based on the events you are handling. (And keep the event handling separate.) Trust me.