Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame.setVisible very slow in debugger

 
Malcolm Storey
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am developing a multi-window app using Swing in Eclipse and it's suddenly started running very slowly, especially in the debugger. It takes two minutes (I timed it - it seems a lot longer when you're waiting!) to open the three initial JFrame windows. Stepping thru with the debugger it seems to spend 10 or 20 seconds in setVisible - presumably it's doing the layout?

The windows aren't that complicated. The content pane use a BorderLayout to lay out the component panels, which themselves have various layout managers. Are there any general principles that one should adhere to? eg not nesting more than n panels deep, or not nesting a panel with layout x in one with layout y?

Obviously each window is built in a RunLater on the dispatch thread - the code is liberally peppered with: Would it help if I split the GUI building into several chained RunLaters?

Or is two minutes to load quite normal?

Once the program starts running in the debugger there's a liveness issue, but it seems OK when running normally.

Be grateful for any pointers or pitfalls to avoid. Many thanks for your thoughts.
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!