I have a Gui application in swing that prints a ticket on a serial thermal printer. When i hit the button that launch this action, my GUI is frozen. I think that\'s because
One very basic rule:
This way we can keep the GUI interactive and responsive.
In Java Event Dispatcher Thread (EDT) is the UI thread, main() method in Java GUI application is not long lived, so after scheduling the work of GUI construction in the Event Dispatcher Queue it quits and then it's EDT that handles the GUI.
Either use Thread to do the Long Non-UI processing work, or use SwingWorker, this is provided in java to do a seamless synchronization between the UI and Non-UI work......