\n is not working at all
Hi, I am doing an app that must show text on a choiceGroup. As the text has many pars and is big I decided to show it in 2 parts.
"First String"+"\n"+"Second string"
on the emulator this works, and on some devices it work too, but on other devices it doesnt.
example:
device1: device2
String1String1Stri.........
String2
and also add a Command "View" to allow me to see the rest of the String that doesnt fit the screen.
Why does this happens. Java is supossed to be portable but it seems that j2me doesnt has a well done portability if it works different on different devices on the GUIs.
Any clue about how to fix it!
[682 byte] By [
MelGohana] at [2007-11-27 5:57:54]

# 1
I don't know about the newline thing but I guess you could try using ASCII 10 and ASCII 13 in your string; my thinking is that different devices may be using a different character to indicate a newline.
But what I wanna point out is that J2ME is portable. Your own post telling us that you tried it on a few devices points that out; if it wasn't portable, you wouldn't be able to do this without major changes in the way you developed an application; you'd have to consider all possible platforms you wanted to work with! With J2ME you only need to concentrate on Java and using the classes you have and not with how the phone/ device was built.
What most people forget/ don't seem to know, is that J2ME only suggests to the device how something should be displayed; how Commands should appear, how the font would be etc. but in the end, all that is out of the hands of your application, it is device and implementation dependent.
Which is why you can never be sure how your application might appear on some device.
# 3
"Which is why you can never be sure how your application might appear on some device."Exactly. But you cant tell to a customer or to your boss, "If you want the application to run as you want, you must buy another device."
# 5
> Exactly. But you cant tell to a customer or to your
> boss, "If you want the application to run as you
> want, you must buy another device."
:) But they have to be told the limitation of the technology they're working with! If they want complete control, they'll have to use something else like VC++ or whatever the native platform of the device is!
And did you you try using ASCII 10 and/ or ASCII 13 in the string? Something like
"First String" + (char) 10 + (char) 13 + "Second string"