Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing Performance(slow swing)  RSS feed

 
Buss Wolf
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I appreciate anyone who could answer my question. It's quite a general one. We developed a Java program written in swing. It works pretty good on most of our PCs. But we have this particular machine where swing runs very slow. The screen dosen't paint completely when you move the window or even freezes. You could see a hole left behind the moving window. This machine is a IBM G40 laptop which has a 3G CPU and 1G memory. It's pretty fast when you run relative large program like Matlab or Mathematica. So I'm wondering what causes the slow swing? Could it be the graphic card? The only part of this laptop that is worse than the other ones is the graphic card, which is an integrated one. Does anyone have this kind of experience that could tell me if it's computer problem or coding problem(we did not optimize our code to improve its performance).
Thanks
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the Swing app do?
 
Buss Wolf
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's like a curve fitting program. You try to get better fit by adjusting the parameters. But I think this has nothing to do with the slow swing because the program isn't really running when we move the windows.
 
Scott Delap
author
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Buss, are you 100 percent sure there isn't some code being executed? I would test things using the custom event queue described in this article.

http://elliotth.blogspot.com/2005/05/automatically-detecting-awt-event.html

If you have some heavy processes going on, it should help you detect them. Next I'll plug my own stuff and recommend reading the Desktop Java Live sample chapters available from the link below on Swing threading.

http://www.sourcebeat.com/TitleAction.do?id=10

Moving these processes off the event dispatch thread should resolve your issues. If you don't have long running EDT processes, my next suggestion would be to look into Swing performance issues resolving video cards. There are probably a bunch of them either open or closed for newer versions at bugs.sun.com. Depending on the version of Java you are running, there use to be some switches to use different pipelines which would help things.

Scott Delap
ClientJava.com
Desktop Java Live
 
Buss Wolf
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! This would help a lot.

Buss
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!