There is a 100,000-character text that need to be displayed. If I put it into String object, I get an error \"constant string too long\". The same is with StringBuffer object.>
I had same problem and the solution was the very big string literal that was assigned to one constant, to split it to several smaller literals assigned to new constants and concatenate them.
Example:
Very big string that can not compile:
private static String myTooBigText = "...";
Split it to several constants and concatenate them that compiles:
private static String mySmallText_1 = "...";
private static String mySmallText_2 = "...";
...
private static String mySmallText_n = "...";
private static String myTooBigText = mySmallText_1 + mySmallText_2 + ... + mySmallText_n;