Chinese Input Method for the low-level interface of j2-based Storage

Source: Internet
Author: User

There are two types of UI interfaces on the J2EE platform: Advanced UI components and low-level UI components. Advanced UI components are easy to use. To create a window, you only need to input parameters to the corresponding structure. However, the advanced UI component cannot customize styles, which are generally the default styles of mobile phones. If you want to make the interface beautiful, you can only use a low-level interface to draw it out. In this case, a problem occurs. When it comes to text input, it will return to the advanced interface to call the input method of the mobile phone itself, which greatly compromises the aesthetics of the program. Therefore, I tried to write an input method similar to the smart ABC method on the PC using j2s, which can be used directly on the low-level interface, because it is drawn from the graphics object. The following are the calling results:

(Figure 1)

This input method is used as a UI component. It is drawn through a graphics object on the interface. It controls the keyboard operation by receiving the key values of keypressed (INT keycode) and keyreleased (INT keycode. The general functions are as follows:

1. Chinese characters, English case, numbers, and special characters are supported.
2. The flashing cursor indicates that the text can be easily inserted and modified by moving the arrow keys.
3. You can restrict functions, such as only Chinese characters and English letters.
4. Copy, paste, and cut of characters (not implemented yet ).

Of course, this input method class requires a textfield or textbox class to be used together. Of course, these two classes also need to be implemented on the low-level interface.

This input method consists of a data file (font) and a class file. The data file size is about 10 KB, and the class file size is about 1000 rows. The font contains all frequently used Chinese characters. The actual heap memory occupied is about 40 kb or lower than this value, because during the test, many other UIS on my interface are running at the same time. This input method will be of great help to the interface style of the applications in the j2e-based architecture. Therefore, I think this memory cost should be worth it.

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: 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.