File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassLoader

 
Dalia Sultana
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a Swing JFrame, which loads on a menu click. The screen is not too simple, but not too complicated either. It has 2 toolbars, a menubar, a JPanel(consisting of a JTable and a filter panel) and a right click context menu for the table. The very first time the screen is loaded, it takes forever fo it to come up. However, it's not as slow the cnsecutive times. I've put it through JProfiler and found out that the majority time is consumed by class loader. Any ideas, how to improve the performence here?

Also, is there a free good profiler that I can use with Eclipse 3.3?

Thanks!
 
Dave Wingate
Ranch Hand
Posts: 262
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a Swing JFrame, which loads on a menu click ...


It sounds like your JFrame is not the first thing that gets loaded in your application, since you mention that it gets loaded form a user's menu click. You might consider having your starting GUI component spawn asimple background thread that calls

Class.forName(SlowLoadingSwingJFrameClass);

That way, when your user finally clicks on the menu, there's a good chance that the classloader will have already loaded the slow-loading Swing JFrame.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic