Search:

Type: Posts; User: hwoarang69

Search: Search took 0.06 seconds.

  1. Re: display text for 1 sec than remove txt java

    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...
  2. Re: display text for 1 sec than remove txt java

    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...
  3. Re: display text for 1 sec than remove txt java

    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;
  4. Re: display text for 1 sec than remove txt java

    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...
  5. Re: display text for 1 sec than remove txt java

    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...
  6. Re: display text for 1 sec than remove txt java

    i c. how about the 2nd part?
  7. Re: display text for 1 sec than remove txt java

    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...
  8. Re: display text for 1 sec than remove txt java

    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)
    {
    ...
  9. Re: display text for 1 sec than remove txt java

    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...
  10. Re: display text for 1 sec than remove txt java

    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...
  11. Re: display text for 1 sec than remove txt java

    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...
  12. Re: display text for 1 sec than remove txt java

    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...
  13. Re: display text for 1 sec than remove txt java

    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 -...
  14. Re: display text for 1 sec than remove txt java

    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?
  15. Re: display text for 1 sec than remove txt java

    so i should drawstring() in paint method and after 1 sec change color same as background?
  16. Re: display text for 1 sec than remove txt java

    o but isnt only way to display message on screen is by "g.drawString();" in paint method
  17. Re: display text for 1 sec than remove txt java

    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...
  18. display text for 1 sec than remove txt java

    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...
Results 1 to 18 of 18