J2's tips-branch text display on the low-level user interface

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.