I'm using a JTextPane with a HTMLDocument inside to read and write HTML via HTMLEditorKit. Everything works quite fine, except that the wonderful full-conform W3C HTML5 I'm putting inside is then written in an ugly, deprecated, obsolete HTML3.2...
So, I looked into the code of java.swing.text.html.HTMLWriter, and I discovered this :
if (writeCSS) {
convertToHTML40(from, to);
} else {
convertToHTML32(from, to);
}
So I thought that I was saved, and a simple setWriteCSS(true) would make me get a much better result... Except that writeCSS is private and there is no setter to modify its value :
private boolean writeCSS = false;
I always knew that Sun people were funny guys... Anyway, I could have just override the current convert method, but the final HTML is still not wonderful.
I'm sure there are somewhere people facing this issue and that wrote their own HTMLWriter. I just can't find any. Could anyone indicate me one ?
Thanks a lot !