如何在Java GUI上添加多行标签? [英] How to add multi-line label on a Java GUI?

查看:178
本文介绍了如何在Java GUI上添加多行标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个Java swing GUI.现在,我想在其上显示一条静态消息,但该消息为多行,而JLabel为单行.

I have made a java swing GUI. Now I want to display a static message on that but the message is multi-line and the JLabel is single line.

如何显示该消息?

我们可以设置JLabel的任何属性来显示多行消息吗?

Is there any property of JLabel which we can set to display the multiple line message?

我必须为多个行使用多个JLabel吗?

Will I have to use several JLabels for multiple lines?

还有其他方法可以显示该消息吗?

Is there any other way I can display that message?

推荐答案

显示多行文本

这篇关于如何在Java GUI上添加多行标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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