Hello there.
I feel kinda stupid at the moment...
I created a Textarea with a SimpleTextAreaModel. To set the text to be displayed I use
Code:
mySimpleTextAreaModel.setText("first line\nsecond line");
//works too:
String foo = "bla\nblubb";
mySimpleTextAreaModel.setText(foo);
This works perfectly and displays two lines as expected.
However I have my text stored in an XML file which I deserialize by using a XMLDecoder.
Code:
// [...]
<void property="weaponDescription">
<string>Standard assault rifle\nFires a shot of super heated plasma</string>
</void>
// [...]
What happens now is that the text is displayed but the newline character
\n isn't recognized and instead is printed to screen.
I set a debug breakpoint and looked inside my String variable to verify that there isn't any escaping going on but the string looks exactly as in the xml file and therefor should produce a line break.
I looked inside the xml file if there's some weird encoding issue but the newline looks legit (\0x5C \0x6E).
I converted the xml deserialized string to a char array but there's also only a simple newline in there.
Now I'm a little bit lost and hope you guys could shed some light on me.