如何在特定时间后动态清理JTextArea [英] how to clean JTextArea dynamically after specific time
本文介绍了如何在特定时间后动态清理JTextArea的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有JTextArea可以将错误预览给用户.
我想要的是在特定时间段后刷新此文本
例如说每6秒要从TextArea中删除文本.
plz help< D
I have JTextArea which previews errors to the user.
what I want is to refresh this text after specific period of time
say for example for every 6 secs text should be removed from the TextArea.
plz help <;D
推荐答案
您可以简单地使用计时器.看看这些链接,它们为您提供了一些如何使用它们的示例:
http://www.rgagnon.com/javadetails/java-0144.html [ ^ ]
http://download.oracle.com/javase/tutorial/uiswing/misc/timer.html [^ ]
祝你好运!
You can simply use a timer for that. Have a look at the links, they give you some examples how to use them:
http://www.rgagnon.com/javadetails/java-0144.html[^]
http://download.oracle.com/javase/tutorial/uiswing/misc/timer.html[^]
Good luck!
这篇关于如何在特定时间后动态清理JTextArea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文