-1

I want to display a countdown timer (which is a JLabel) on the JComponent. I know the timer works but the problem is I can't display it.

Could someone help me about this problem?

papski
  • 1,241
  • 5
  • 28
  • 52
  • 1
    I am sorry to say but it is not a good question. What does not work? What did you try? Try to localize problem and fix it. Do not expect from the community to debug your code. If you have specific problem try to localize it in 2-3 lines of code and ask question again. – AlexR Sep 21 '11 at 09:46
  • 4
    1) [What Have You Tried?](http://mattgemmell.com/2008/12/08/what-have-you-tried/) 2) For better help sooner, **post an [SSCCE](http://pscode.org/sscce.html)** (as has been mentioned before). 3) There is no need to add the [tag:intellij-idea] tag when the problem has nothing to do with the IDE. 4) There is no need to add "Thanks.." to a question - it is just noise. – Andrew Thompson Sep 21 '11 at 09:52
  • @AlexR sorry for that. My problem is I can't display the timer inside the paint but I know the timer is working. It's just I can't display it. Could you give some idea how to do it? or I have to draw the timer using drawstring? ;-) – papski Sep 21 '11 at 09:52
  • 2
    Here's a count-up [example](http://stackoverflow.com/questions/5528939/java-swing-two-classes-where-to-put-if-statements-and-new-actionlisteners/5529043#5529043). to get you started with your [sscce](http://sscce.org/). – trashgod Sep 21 '11 at 11:53
  • I really got a problem on how to display the timer. :-( – papski Sep 21 '11 at 13:56
  • 1
    Why are you doing custom painting? trashgod gave you an example that just sets text on a JLabel which is much easier than trying to do the painting yourself. – camickr Sep 21 '11 at 14:16

1 Answers1

1

Take look at Swing Timer

keuleJ
  • 3,418
  • 4
  • 30
  • 51