I'm looking for a way to disable HTML parsing of the 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 output in the JComboBox will look like this:
<a>
<br>
<body>
//notice the blank space where <html> should be
<link>
<meta>
So the problem is that the html-tag is parsed since I add a < sign in front of it, how can I work around this? I've tried to use "\u003C" instead, but it still parses as html and the tag doesn't show up in the list.