如何更新JLabel文本? [英] How to update a JLabel text?

查看:142
本文介绍了如何更新JLabel文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个Hangman游戏,其中一件我要制作的东西是 JLabel 文字,用 ex更新。_ _ _ _,视字而定。

I am making a Hangman game and one of the things I want to make is JLabel text , which updates with ex."_ _ _ _ ", depending on word.

如果你愿意,我可以分享代码。

I can share code if you want.

推荐答案

尝试使用带有标签的 setText();

这篇关于如何更新JLabel文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆