Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Melanie Fitzgerald

Greenhorn
+ Follow
since May 30, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Melanie Fitzgerald

Hi,
I have several textfields in which I want to set the text. I then I need to do some animation. My problem is that the text doesn't show up in the textfields until the animation has completed. Here is a simplified version of my code:
t1.setText("blah");
t2.setText("blah");
t3.setText("blah");
drawAnimation();
*******************************
drawAnimation () {
....
for (int i = 0; i < interval; i++) {
Thread.sleep(100);
......
// do drawing stuff
}
}
I don�t know if this helps, but what I�m drawing is an arrow which grows about 10 pixels every .1 seconds (why I need the sleep).
I've tried subclassing textfield so that setText() calls the textfields�s paint method right away but this still won't force the text to show up until after the animation is completed. I've also tried subclassing Thread and putting all of the animation in the run method with no luck. Any help would really be appreciated!!
Thanks!
19 years ago
I have an applet that when the refresh button is pressed within a browser, the applet does not reload properly. Shift-refresh does not fix the problem either. So I have written a method reset() which "resets" the applet and I've put it in the start() method of the applet. However, this creates a new problem. When a Netscape browser is resized, it calls start() which will reset my applet...so this is no good. Is there a better way to go about this? Also, in IE on the Mac, when refresh is pressed, the html page reloads but the applet does not appear.
Thanks!
19 years ago
I'm actually trying to change the color of the cursor(caret)inside the textField, not the actual text itself.
19 years ago
Can anyone suggest a way to change the color of the caret in a textField, without using Swing ?
19 years ago