如何更改按钮标签 [英] How to change the lable of button
本文介绍了如何更改按钮标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在用户每次单击5分钟后将JButton的标签从一个"更改为两个".
,请您尽快提供您的建议.如果您愿意和您分享经验,我将不胜感激.
预先感谢.
Hi,
I want change the lable of JButton from "one" to "two" after 5 mins, when ever user clicks on that.
can you please provide your suggestions ASAP. I''d appreciate if you would be kind enough to share your experience.
Thanks in advance.
推荐答案
Java教程 [^ ]
如何编写ActionListener [线程教程 [
Java Tutorials[^]
How to write an ActionListener[^]
You will have to use an ActionListener, which will be triggered when the button is pressed. That one then can change the label text of the button.
Waiting 5 Minutes requires a Thread:
Tutorial on threads[^]
I can also recommend to buy a good old fashion book, that one reveals such secrets most ASAP.
这篇关于如何更改按钮标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文