繁体   English   中英

JTextField与HTML标记一起使用

[英]JTextField together with HTML tags

我正在使用Java 7.我正在尝试使用HTML标签格式化文本。 我把文字传入

JTextField text = new JTextField();
text.setText("<html><body><p>The program performs encryption operations on the following ciphers: </p></body></html>");

但程序也打印HTML标签。 那个文本样本只是一个例子。 可能是什么问题? 干杯

JTextField支持HTML 你可以改用JTextPane

JTextPane text = new JTextPane();
text.setContentType("text/html");
text.setText("<html><body><p>The program performs encryption operations on the following ciphers: </p></body></html>");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM