How to solve with aid of Multithreading..  
Author Message
ganeshamutha@gmail.com





PostPosted: 2006-10-3 17:44:00 Top

java-programmer, How to solve with aid of Multithreading.. Hi,

Please, could you any one give me the solution for following
problem..

A Dialog box (JDialog) getting input parameters from user..
itself a button attached.. if i click the run
button those parameters are passing to 'C' core which connected by
JNI.. core executing few minutes..
and returning to java.. mean while the dialog box (after
setVisible(false) instuction)
appearing as plain brown box till control return from 'C'..

how can i apply multithreading feature of java's here inorder to
get..

Dialog box should get disappear as soon as button has clicked.
and Percentage of completion should display as in progress bar..
while 'C' running on background..

(or)

Dialog box should get Disappear as soon as button has clicked.
and some processing animation should display till 'C' running on
background...

 
Michael Rauscher





PostPosted: 2006-10-3 20:41:00 Top

java-programmer >> How to solve with aid of Multithreading.. Hi,

email***@***.com schrieb:
> how can i apply multithreading feature of java's here inorder to
> get..
>
> Dialog box should get disappear as soon as button has clicked.
> and Percentage of completion should display as in progress bar..
> while 'C' running on background..
>
> (or)
>
> Dialog box should get Disappear as soon as button has clicked.
> and some processing animation should display till 'C' running on
> background...
>

There are several ways but all follow one principle: create a thread for
long running tasks.

You can create a thread on your own or you may want to use SwingWorker
or ProgressMonitor instead.

In any case: don't modify components from outside the EDT.

Bye
Michael
 
Nigel Wade





PostPosted: 2006-10-4 16:29:00 Top

java-programmer >> How to solve with aid of Multithreading.. email***@***.com wrote:

> Hi,
>
> Please, could you any one give me the solution for following
> problem..
>
> A Dialog box (JDialog) getting input parameters from user..
> itself a button attached.. if i click the run
> button those parameters are passing to 'C' core which connected by
> JNI.. core executing few minutes..
> and returning to java.. mean while the dialog box (after
> setVisible(false) instuction)
> appearing as plain brown box till control return from 'C'..
>
> how can i apply multithreading feature of java's here inorder to
> get..
>
> Dialog box should get disappear as soon as button has clicked.
> and Percentage of completion should display as in progress bar..
> while 'C' running on background..
>
> (or)
>
> Dialog box should get Disappear as soon as button has clicked.
> and some processing animation should display till 'C' running on
> background...


See this section of the tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

and this:
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html


--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : email***@***.com
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555