> >> >> > >> let's say....i have a jtextfiled ....
> >> ..
[quoted text clipped - 85 lines]
>
> - 따온 텍스트 보기 -
>> >> >> > >> let's say....i have a jtextfiled ....
>> >> ..
>[quoted text clipped - 85 lines]
Please trim text no longer immediately relevant to a reply.
(There was no need to quote 85+ lines of earlier conversation,
just to ask your question.
...
>oh...ok...if it is that case what should i do ??
You might get some pointers from *this* JProgressBar demo.
<http://java.sun.com/docs/books/tutorial/uiswing/examples/components/ProgressBarD
emoProject/src/components/ProgressBarDemo.java
>any suggestions??
Sure.
- Post SSCCEs*, rather than code snippets.
- Spell J2SE classes with correct capitalisation, to indicate
that they are J2SE classes, rather than some 3rd party
equivalent. On this note, it is JTextField and JButton,
as opposed to 'jtextfiled' and 'Jbutton'.
- Start each sentence with a single Capital Letter.
- Always capitalise the word 'I'.
- Add a single full-stop '.' at the end of each sentence, and
2 spaces before start of the next.
- Note that one single '?' is enough to indicate a question.
* <http://www.physci.org/codes/sscce.html>
<http://homepage1.nifty.com/algafield/sscce.html>

Signature
Andrew Thompson
http://www.physci.org/
Lew - 25 Nov 2007 18:42 GMT
> * <http://www.physci.org/codes/sscce.html>
Still shows litter:
> <%@ include file = "/codes/all_inc/pageInfo.f.html" %>
in the upper right-hand corner, and
> <%@ include file = "/all_inc/call_google_js.f.html" %>
in the upper-left, under the "Find" button.
> <http://homepage1.nifty.com/algafield/sscce.html>
Clean and vivid. Is that yours, or a mirror?

Signature
Lew
Andrew Thompson - 26 Nov 2007 01:58 GMT
>> * <http://www.physci.org/codes/sscce.html>
>
>Still shows litter:
Will probably have a better version to upload within 24-48 hours.
>> <http://homepage1.nifty.com/algafield/sscce.html>
>
>Clean and vivid. Is that yours, or a mirror?
That is hiwa's mirror (for which I am very grateful, given
it has been significantly more accessible than my own
copy).

Signature
Andrew Thompson
http://www.physci.org/
> > Being threadsafe simply means that setText can be called from another
> > thread--your loop is still blocking the EDT. Andrew's version works
[quoted text clipped - 13 lines]
>
> any suggestions?? matt??
You have to perform the action in a separate thread, like in the following
example.
private void gogo(){
Thread t = new Thread (new Runnable () {
public void run () {
try{
for (int i = 0; i < 100000; i++) {
this.txtNo.setText(i+"");
}
}catch(Exception e ){ e.printStackTrace (); }
});
t.start ();
}
This works only for threadsafe methods like setText. Virtually everything
else (except repaint) is not threadsafe and you must perform the actual
update in the EDT. (Confusing, yes? Time-consuming task code must NOT be
in EDT, update code MUST be in EDT). The example provided by Andrew shows
how to use SwingWorker to setup a thread to do the working off the EDT and
it manages to do the done method in the EDT. Also, that example shows the
correct way to launch a GUI in the EDT rather than in the main thread.
http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html
Matt Humphrey http://www.iviz.com/
jlc488 - 30 Nov 2007 01:41 GMT
> > > Being threadsafe simply means that setText can be called from another
> > > thread--your loop is still blocking the EDT. Andrew's version works
[quoted text clipped - 43 lines]
>
> - 따온 텍스트 보기 -
thanks..it really helped me a lot...
thank you matt..i really appreciated...bye~~
>> Being threadsafe simply means that setText can be called from another
>> thread--your loop is still blocking the EDT. Andrew's version works because
[quoted text clipped - 6 lines]
>
> any suggestions??
After I thought I understood threading and the dependence of most of
Swing on the Event Dispatch Thread, I found it helpful to read about
Thread.start(), SwingUtilities.invokeLater() and SwingWorker.
Something that I am currently finding useful is the code at
http://www.clientjava.com/blog/2004/08/20/1093059428000.html
After including that in my project I just insert
RepaintManager.setCurrentManager(new ThreadCheckingRepaintManager());
at the beginning of my program. It seems quite good at telling me when
I've made a mistake in running Swing code from the "wrong" thread.