thanks for trying but what you saying is not working for me.
if any one else looking for this solution try this,
When you set the text, set a counter to 100. In your timer's actionPerformed...
Type: Posts; User: hwoarang69
thanks for trying but what you saying is not working for me.
if any one else looking for this solution try this,
When you set the text, set a counter to 100. In your timer's actionPerformed...
o so something like this?
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.JApplet;
public...
like this? still no change
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.JApplet;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.JApplet;
public class main extends JApplet...
2nd part is to change showMeg to false after 1 sec. right?
i tried puting (showMeg = false) in actionPerformed, paint method in if statment, in start method after timer_class2.start(). but it just...
i c. how about the 2nd part?
ah i c so in paint method i can do something like this to test:
2nd part is to change showMeg to false after 1 sec. right?
i tried puting (showMeg = false) in actionPerformed, paint method in...
i can test if timer is running if its running than print message and stop timer. if timer is stop than print "" string?
if(timer_class2.isRunning() == true)
{
...
i think iam started to get it now.
i had a question on:
i am having some difficult seeing how to clear it. les say if i doing testing in paint method and i draw it for 1 sec. but that will...
ok. all i need help wth is to make string clear after 1 sec and no change to 1st rect animation.
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import...
ok. all i need help wth is to make string clear after 1 sec and no change to 1st rect animation.
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import...
but i told you the problem why would you need to see it?
the problem is that i cant clear string after 1 sec. right now if i run this code. 1st animation works fine but 2nd animation i can print...
ok let me try again:
to display drawstring on screen for 1 sec than clearing it. i should do this: right?
1 - i am using timer so check
2 - i am drawing in paint() g.drawstring so check
3 -...
so what you are saying is that i shouldnt draw string in paint method. bc onces you draw in paint() than you cant undo.
and i should use JLabel? and draw in init() function?
so i should drawstring() in paint method and after 1 sec change color same as background?
o but isnt only way to display message on screen is by "g.drawString();" in paint method
1)Use a Timer. --check
2)Show message --check
3)Start timer for desired time --(not sure but i think its this)
4)when timer calls its listener, clear message
can you plz explain this...
i have two animation going on screen.
one animation is a rect going to right. i dont want this animation to stop
2nd animation is message coming on screen for 1 sec and removeing it.
right now...