Blackberry ui app (1) | blackberry Interface Program (1)

Source: Internet
Author: User
Topic: Develop blackberry applications in java

The ui program of blackberry starts from the main function and needs to do three things in this main function.

1. Create a UiApplication object instance

2. Create a Screen object instance and add it to the Screen queue.

3. Place the UiApplication object instance created in step 1 to the event scheduling queue

Code:

| -- StatUiApplication. java

1 public class StartUiApplication extends UiApplication {
2 public static void main (String [] args ){
3
4 StartUiApplication s = new StartUiApplication (); // 1. Create a UiApplication object instance
5
6 UiApplication. getUiApplication (). pushScreen (new HelloScreen (); // 2. Create a Screen object instance and add it to the Screen queue.
7
8 s. enterEventDispatcher (); // 3. Put the UiApplication object instance created in step 1 to the event scheduling queue
9
10}
11}

Note: steps 2 and 3 cannot be reversed in the program process. If there is no Screen object in the program, the program will always "die" there, ignore the Screen after you call the enterEventDispatcher () method.

 

 

| -- HelloScreen. java

1 public class HelloScreen extends MainScreen {

2
3 public HelloScreen (){
4 super ();
5 setTitle (new LabelField ("hello ^ screen "));
6}
7}

 

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.