AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Prioritising the user interface

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Andrew Mallinson
Guest





PostPosted: Sat Nov 22, 2003 12:41 am    Post subject: Prioritising the user interface Reply with quote



Hi

Ive currently set my program up with a simple JFrame interface and a couple
of JMenus and JMenuItems. Just enough to allow me to read in some files and
start the program running.

The program starts about 50+ threads running in the background. Before the
threads are set running the interface works fine, however whilst the threads
are running it becomes a lot less responsive (i guess due to the extra
processing power the threads require).

Is there a way to maybe prioritise the user interface (i guess this runs on
a thread as well) so that it is given more of the processing power (time)
and can therefore respond better when i click the mouse on one of the menu
options.

Many thanks in advance for your help
Regards
Andy


Back to top
Harald Hein
Guest





PostPosted: Sat Nov 22, 2003 8:03 am    Post subject: Re: Prioritising the user interface Reply with quote



"Andrew Mallinson" wrote:

Quote:
Is there a way to maybe prioritise the user interface (i guess
this runs on a thread as well) so that it is given more of the
processing power (time) and can therefore respond better when i
click the mouse on one of the menu options.

You can give threads a different priority, read the API docs ... BUT
this is just a suggestion. JVMs are allowed to ignore it. I would
suggest you start less threads, (queue the tasks), and do less updates
to the GUI.

Back to top
Stephan Friedrichs
Guest





PostPosted: Sat Nov 22, 2003 3:47 pm    Post subject: Re: Prioritising the user interface Reply with quote



Andrew Mallinson wrote:

Quote:
Hi

[...]

Is there a way to maybe prioritise the user interface (i guess this runs on
a thread as well) so that it is given more of the processing power (time)
and can therefore respond better when i click the mouse on one of the menu
options.


SwingUtilities.invokeLater(new Runnable() {
public void run() {
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
}
});

If this is not the usual setting...


Quote:

Many thanks in advance for your help
Regards
Andy


Hope this helps - Stephan

--

Spam protection: If an email response to this posting
is necessary, please respond to:

SFriedrichs [at] t-online [dot] de

--

http://home.t-online.de/home/sfriedrichs/

JAddressBook: 1.1


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.