Use the least code to beautify your j2s!

Source: Internet
Author: User

The following code is from http://blog.csdn.net/hellogv/. for reference, see the source!

Before starting this article, make sure that you want to change the interface of your j2_based program to the following:

 

If you have already thought about it and want to change it to this way, continue reading .......

Prepare the following before beautifying your j2s program:

1. Please refer to the Attachment: in fact, the j2mepolish-2.0 RC has been released, but because the younger brother I always encounter errors when compiling the example, and just use the J2ME-Polish GUI, So switch to the j2mepolish-1.3-beta3.jar on the line.

2. I am using net beans 5.5 + mobility pack. If you are using net bean 5.0 or below, it doesn't matter. Installation and debugging are similar, but if you are using esclipse, you can skip this step.

3. Install j2mepolish-1.3-beta3.jar, installation, please note that the installation path of j2mepolish-1.3-beta3.jar must not contain Chinese characters! If it contains, it cannot be compiled after successful installation, because build is used during compilation. XML, and this build. XML contains the installation path of the j2mepolish-1.3-beta3.jar, if build. XML contains Chinese characters. during compilation, the UTF error is prompted.

All in all, the installation path for the j2mepolish-1.3-beta3.jar must not contain Chinese characters!

After the preparation is complete, the next step is to set up the IDE and debugging example (the following description is mostly reproduced on the network ):

1. Open IDE, create a project, file-> new project-> mobile application, give the project name for test, select the project folder, and remove the "Create Hello MIDlet" option, click "finish" to create the project.

2. Go to the installed J2ME-Polish folder, enter samples-> menu, copy all the files and folders in the menu folder, paste them under the for test folder, and overwrite the original file. Extract the SRC from the source folder and overwrite the original empty SRC.

3. Return to netbeans, right-click the projects view, and select refresh folders ". You can see the "de. Enough. Polish. Example" package in the for test project.

4. Right-click for test and select Properties to go to build and select libraries and resource ", select Add JAR/zip and add the installed J2ME-Polish-import-enough-j2mepolish-client.jar to the project.

5. Switch to the "file" view and right-click the overwritten build. XML, select "run target"-> "text", and then select "run target"-> "j2mepolish". Then, the j2mepolish will compile the menu example.

The simplest expansion example is to achieve more beautification:

Go to the installed folder of wtk22 (or wtk later) and go to apps-> uidemo. Have you seen build. xml? This shows that the code in uidemo has been compiled and debugged according to the above example for test.

Take a closer look at the sample code in uidemo. Some examples have introduced de. enough. polish. × (× can be ui or UI. list ..... if you do not have one, you can manually introduce it as long as de is introduced. enough. polish. ×, You can optimize your j2s program. It's easy.

In summary, J2ME-Polish is indeed a very goodThird-party GUI library,Of course, it also has a lot of other libraries for the use of j2s programmers.

On Valentine's Day, I hope you will like 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: 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.