• Post Reply Bookmark Topic Watch Topic
  • New Topic

Optimizing my Swing app

 
M Jay
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written a Swing application that contains a few JPanels, JButtons, JTextFields, and JLists. However it's proving to be quite slow. This means that for example when I minimize then maximize the main window, it takes a while before the components show on it. Similarly, when starting up the app, it takes quite a while for the components to show.

Could anyone give me some advice on how to avoid this and make the application behave like a normal windows application?

Many Thanks
 
Chad Clites
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without seeing code, that is a little hard to say. I had a GUI lag because I had accidentally created an infinite loop in the background. I was not able to understand what the problem was until I happened to check the task manager, and noticed that the application was taking up 99% of available resources....

And depending on what your application is doing, it might not even be the GUI.. is it reading data from a poorly designed database? Is it retrieving data from a remote system? Is the system that it is running on already low on resources? Have you tried isolating parts of the app to see if one thing causes it to slow down more than another? (for example, just draw the window with no buttons, then draw the window with buttons, draw the window with lists but no buttons, etc.) You may hit on a section of code that suddenly slows everything down.

So I guess what I am trying to say is that it may not be your app at all, and what have you tried? What OS are you running on (probably doesn't matter, but still nice to know when doing diagnostics).
[ November 29, 2005: Message edited by: C Clites ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!