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
Harald Hein - 22 Nov 2003 08:03 GMT
> 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.
Stephan Friedrichs - 22 Nov 2003 15:47 GMT
> Hi
>
[quoted text clipped - 4 lines]
> 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...
> Many thanks in advance for your help
> Regards
> Andy
Hope this helps - Stephan

Signature
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