【发布时间】:2018-05-05 20:20:09
【问题描述】:
我使用的一行代码与此一模一样:
MyFrame.add(new JLabel("<html><body>Information to be displayed</body></html>"));
每次我执行我的项目时,JFrame MyFrame 中都不会显示任何内容,包括与 JLabel 无关的其他数据。请有人告诉我哪里出错了。
【问题讨论】:
-
(1-)
Please someone should kindly tell me where i'm going wrong.- 我们怎么可能根据一行代码知道你做错了什么。nothing displays in the JFrame MyFrame including other data not related to the JLabel.- 所以 HTML 不是问题。首先阅读 How to Use Labels 上的 Swing 教程中的部分以获取工作示例。下载演示代码并将演示代码中的标签更改为使用 HTML。 -
感谢您提供该链接。我能够学习使用 html 的新方法。将尝试应用它们。