uml*_*uml 2 html java swing jtextfield
我正在使用Java 7.我正在尝试使用HTML标签格式化文本.我把文字传入
JTextField text = new JTextField();
text.setText("<html><body><p>The program performs encryption operations on the following ciphers: </p></body></html>");
Run Code Online (Sandbox Code Playgroud)
但程序也打印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>");
Run Code Online (Sandbox Code Playgroud)