Java Reference
In-Depth Information
The application consists of two screens: the main screen, which shows the current
weather as obtained from a server, and a settings screen, which lets you enter a city and
state in the United States. For this chapter, the weather data and location data are static;
in Chapter 6, you will learn how to persist user settings, and in Chapters 12 and 13, you'll
see various ways of interfacing with the Web (including using web services) to obtain
real-time data for your application.
Walking Through the Creation of WeatherWidget
To create the WeatherWidget application, follow the steps in this section.
Note If you'd rather skim these steps before looking at the resulting project, you can find the source code
that results from this sequence of steps in the WeatherWidget directory of the sample code for Chapter 3,
found in the Source Code/Download area of the Apress web site ( http://www.apress.com ).
Creating the Project and Forms for the Screen
In this section, you'll learn how to create the project containing the application, as well as
the forms that implement the screens of the application.
1. Within the NetBeans IDE, choose CREATE NEW PROJECT from the Welcome tab
of the editor.
2. From the dialog that appears, choose Mobile from the Categories column, and
choose Mobile Application from the Projects column. Click Next.
3. Enter WeatherWidget for the application name, and select a location for the
project directory. Leave both Set as Main Project and Create Hello MIDlet ticked.
Click Next.
4. Leave the defaults set, and click Finish to finish the New Project wizard.
5. With the wizard complete, the NetBeans IDE brings you to the Flow Designer (in
the Editor window), which Figure 3-3 shows. Here you map out the flow between
the screens of your application. Begin by selecting and renaming the helloForm
instance you created to wxForm in the Flow Designer.
 
Search WWH ::




Custom Search