When I call the backend with sql for fetching/updating data, the frontend becomes unresponsive until the backend call is returned and the JVM queues all the events in that time to be processed afterwards. Can some one please suggest a way to counter this situation.
Although logically the application should not do anything until the call is returned, however for that matter, I want to disable some buttons and refresh a JLabel saying "processing... Please wait", but the JVM, is trying to be over-smart and deferring these repainting/events until after the backend call returns. Of course, I am performing the gui changes before making the backend call.
Darryl is correct -- the JVM is acting correctly in this situation and when you study a bit more into concurrency and Swing you will see why. Please read the tutorial that was linked to in Darryl's helpful post for the gory details, but in a nutshell, you'll need to do all of your time / cpu -intensive processing off of the Swing thread and in a background thread, but at the same time take care to make Swing calls on the main Swing thread, the EDT. And while it may sound complex now, like anything else, the more work and struggling you do with this type of problem, the easier it will get for you.