Disable HTML parsing in JComboBox.addItem (o)
I am looking for a way to disable HTML parsing of addItem () method in JComboBox ().
JComboBox jHighlight = new JComboBox();
for (int i = 0; i < tl.size(); i++) {
//getTagname() returns a string like "br", "a", "body" or "html"
jHighlight.addItem("<" + tl.get(i).getTagname() + ">");
}
The result in the JComboBox will look like this:
<a>
<br>
<body>
//notice the blank space where <html> should be
<link>
<meta>
So the problem is the html tag is parsed, since I add <sign before it, how can I get around this? I tried using "\ u003C" instead, but it still parses as html and the tag doesn't show up in the list.
0
daSnail
a source
to share
2 answers
I believe it will do one of the following two statements:
highlight.putClientProperty("html.disable", true);
highlight.putClientProperty(
javax.swing.plaf.basic.BasicHTML.propertyKey, null
);
If you have it in the middle somewhere, you create and configure components, you may need to install it for everyone. HTML text design in component support is not good.
+1
a source to share