NBDemoMobilityCDC

CDC Development with Mobility Pack (5 Minutes)

Description

This demo showcases the CDC development with Matisse GUI builder and Mobility Pack.

Product Versions Supported

6.0 Beta1+

Points to Hit

  • New CDC devices are coming, they're more powerful and allow developers to use AWT or even Swing on mobile devices.
  • Thus mobile development is getting closer to Java SE development.

Demo Prep

  • Install NB 6.0 beta1 or higher with Mobility Pack.
  • Get Wireless toolkit for CDC from here and install it.
  • Set up Wireless toolkit for CDC in NetBeans using Tools | Java Platforms | Add platform | CDC | Find directory where you installed CDC WTK.

Gotchas

We're at Beta, anything can go wrong.

Demo

  • Create a new application using New Project | Mobility | CDC Application. GUI Builder is opened.
  • The goal is to create following application:

Image:cdc_demo_NBDemoMobilityCDC.png

  • Resize the form to a rectangle with sizes as you can see on the screenshot above.
  • Drag & drop a tabbed pane.
  • Drop two tabs on the tabbed pane and change the tab names to Contact and Other.
  • Add a panel.
  • Change it's border to Titled border and change the name to Personal.
  • Create three labels and textfields for firstname, surname and nickname.
  • Add the second panel.
  • Change it's border to Titled border and change the name to Address.
  • Add a label for Address:
  • Add a textarea for address.
  • Change the number of colums to 15 so that the textarea doesn't have scrollbars in the design view.
  • Add OK and Cancel buttons.
  • Select both and use the same size functionality to adjust their sizes.
  • Run the application. You should get following GUI:

Image:cdc_phone_NBDemoMobilityCDC.png

  • Change the device to Sun VGA using project properties | Platform | Device.
  • Run the application again. Components shouldn't resize properly.
  • Go back to design mode and modify all necessary components to resize.
  • Run the application again. Components should resize properly now:

Image:cdc_phone_big_NBDemoMobilityCDC.png

  • Choose the OK button and add an event using right click | Events | Action | ActionPerformed.
  • Use System.exit(0); as the code for this action.
  • Run the application again. Show that once you click on OK the emulator gets closed.

Demo Cleanup

Delete the demo project.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo