title: How to preload classes in Java?
body: <p>The first opening of a new JInternalFrame in my Swing interface takes some time. According to the profiler, most of this time is spent in the Classloader.loadClass() method. I understand that it loads classes dynamically when needed and indeed the next time I open the same frame, it is much faster.</p>
  
  <p>This application has a login screen, and then a time with an empty desktoppane before the user opens one of those internal frames. I figure that since I have some "down time", I could use it to preload some common classes in background, so that when the user actually opens an internal frame, it goes much faster.</p>
  
  <p>Is there a way to achieve that, other than having to generate an entire path of "dummy contructors" through my panels and actually initialize an instance of those classes?</p>
  
  <p><em>Ideally, if it could cascade such loading, it would be even better. A bit like the work done by classfileset in ant</em></p>