In general (with/without Javassist), the Java GUI is executed by a
single thread dedicated for GUI. This thread is different from a thread
Since your program uses the GUI thread for running another user
program, main() of that user program is also run by the same
thread as GUI's. I guess that this configuration might confuse
the GUI library.
Your problem might be solved if the button-pressed listener
starts a new thread, which executes Loader#run().
I'm not sure that this way is correct but hope it helps.