J2EETips-text display by branch on the low-level user interface
From:Http://blog.csdn.net/mailbomb
On j2- in the development of the low-level user interface, you may need/ Span> canvas displays a large number of texts, such as information about interfaces, game instructions, and game announcements. If the text content and length are fixed during design, it is neither conducive to modification nor maintenance. The following describes a simple method to implement a simple and maintainability method.
Implementation Method:1, Make all the information to be displayed into a string.
2, Compile a method to convert the string into a string array as required.
3And display the converted array in a loopCanvas.
To modify the displayed information, you only need to modify the string containing the displayed information. You can separate the new string according to the previous standard. To modify the number of characters displayed in each line, you only need to modify the writing method.
Using this implementation method, you can easily display some long text information, even a variable-length string.
If you have other better implementation methods, please share more with us.