Hello. That function worked fine firstly. Then i started to change some code, but nothing essential, just changing some variables to private class fields etc.
I've restarted the OS , but has same output
this is my code now:
doc = (AbstractDocument) jTextPane1.getDocument();
FileReader theFileIO = null;
char[] c = new char[1];
try {
theFileIO= new FileReader("/home/alexandru/Desktop/index.html");
while(theFileIO.read(c)!=-1){
System.out.print(""+c[0]); // prints to the console
doc.insertString(0, new String (c), mas); //prints in the jTextPane1
}
} catch (Exception e) {
System.out.println("Failed to load file index.html");
System.out.println(e);
}
Where mas is : private MutableAttributeSet mas = (MutableAttributeSet)new SimpleAttributeSet ();
The console says:
<html>
</html>
Which is the content of the file. But on my JTextPane1 i get:
>lmth/<
>lmth<
I don't get it! :/