开发者

String appearing for a short of time [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. 开发者_如何学JAVA

I created a string and i wanted it to appear to like 10 seconds and disappear again how can you do that using java ? Im using swing and i want apply this on a label Sorry for not specifying , i'm still new to java


If this is Swing, then use a Swing Timer. Set it to non-repeating, and call its constructor with the time in milliseconds that you'd like to show the String, here 10 x 1000. You could show the text in a JLabel by calling setText("your string") on the JLabel first and then call setText("") again on the JLabel from within the timer's ActionListener's actionPerformed method.

If this is not Swing, and even if it is, you need to provide a lot more detail for your problem to be fully solvable here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜