Commands were changed to Item commands in X4.
Now we move to mobile devices, and J2ME. Use NetBeans Mobility Pack (or Sun Wireless Toolkit) to edit and build your application, but ensure that there is no NetBeans libraries left in the sourcce code.
If you have a mobile phone with MIDP >= 2.0, install your applications to that too.
An example implementation (.jar and .jad is on web-page).
The answer to the X-exercise has to be a single .java source file with main class name the same as your username (with lowe-case characters). Further, no packages should be used. To achive this in NetBeans, use you username as the MIDlet name, place it in the default package. The source file to sublit will be at project/src -directory.
If you had another MIDlet (class) name, you can change it with an editor too.
The answers to X-exercises have to be unique for every student. Not even partial copies of the same answer are allowed. The answer has to be sent via email by Thursday 2:00 pm (the previous day) according to the instructions below. You will receive an acknowledgment upon successful processing within few minutes. Answers will be graded. The answer must also contain a short self-evaluation in which you describe whether the program works, has some problems (tell which), or does not probably work; how good structure is has, what could be improved, etc. The self-evaluation must be stored as a comment within the program. A correct and proper self-evaluation is worth one point (in case of a proper answer).
Send your answer to using cs to user sjuva
with a subject
GUI_X4_username
(case-sensitive, with underscores, username
is your username), and the answer
(with self-evaluation) as the body of the message (no attachments). Most
reliably using program /usr/ucb/mail at cs, type into command line:
/usr/ucb/mail -s GUI_X4_username sjuva < username.java
where username
is your cs username and
username.java
is the single
source file containing your answer.
Other than cs.joensuu.fi users got separate instructions on class naming with X1, continue with them.
Make a Celsius-Fahrenheit-Kelvin -converter like in exercise 1-2 in J2ME. The application converts between Celsius, Fahrenheit, and Kelvin degrees. For each unit, there is a text field showing the temperature, and an item command that activates the conversion from that unit to the other units. Additionally, there is a gauge to adjust the number of decimal places (0..8). Adjusting gauge adjusts all the fields.
Notice, this is a normal exercise, do not submit by email beforehand.
Make count-down timer ("egg-timer") similar to the one in X2. The timer shows digital remaining time and two gauges. You can select how to implement the interaction with the user. Either use entering time to text field, or use adjusting the gauges. The other component is synchronized with the one user adjusts. A single command is used to both Start and Stop the countdown. No autostart -feature is needed. The alarm is shown as an Alert.
Use Timer to give clock update signals, not threads needed.
Last modified Sat Nov 24 22:30:17 EET 2007 SJ