Java jtextfield settext not updating

Java jtextfield settext not updating

You don't really need

Having said this, I think I'm just going to try to recreate what you're trying to do here into one class.

You are overriding the setTextThen the code enters

You don't really need two separate classes unless the listening portion is excessively long. Then the code enters a while loop that takes about seconds to complete. You are overriding the setText method. The cosole shows me I have the correct record. But it looks like you have defined your textfield as both an instance variable and local variable.

However, there are several problems not in the order provided, necessarily. Even if you could run this, the button wouldn't work at all because the button hasn't been told that it does anything. You aren't even using the args array in the createGui method. You aren't adding any components to the frame. This fires an event which connects to a database table and retrieves the first record.