JApplet runs 30x slower than Java application GUI
===

I work in HPC. I have both an applet and a Java client application that display information about jobs (jobID, jobname, userID, etc.) running on the cluster via information received from our TORQUE job scheduler. 

Recently, I added buttons to sort the data by category by ascending or descending values. With this addition, where the user has the ability to force an update of the display by sorting the data (previously I had a timer that received new data from the server every 10 seconds and subsequently updated the display), I noticed a disparity in performance - the applet lagged significantly. Putting in timing code, I found that the application took an average of 0.05 seconds to setContentPane() whereas the applet took an average of 1.50 seconds to perform the same operation with the same code. This issue is the same whether the applet is being run in appletviewer or a browser. 

I want to emphasize that virtually all of the code is the same. The only significant difference is that the JApplet makes setContentPane() (and other) calls on itself, whereas my application makes these calls on the JFrame (e.g. frame.setContentPane() ).

Curiously, the first call to setContentPane() for the applet returns in ~0.13 seconds. However, all subsequent calls require the previously noted time. 

Any suggestions? I'd much rather have a functioning applet so I don't have to push the application on my user community.