Sun J2ME Wireless Toolkit

The Sun J2ME Wireless Toolkit supports the development of Java applications that run on devices such as cellular phones, two-way pagers, and palmtops.

More information about the Sun J2ME Wireless Toolkit can be found at:

Setup, build and run teapot4_background.m3g on Sun J2ME Wireless Toolkit 2.2.

Operating system used
Windows XP Home Edition Version 5.1 SP 2

Software prerequisites
Sun J2ME Wireless Toolkit 2.2

  1. Start "KToolbar".

    Sun J2ME Wireless Toolkit 2.2 (KToolbar)

  2. Create a new project, press button "New Project".

  3. Enter the following project details:

    Project Name: Teapot4M3G
    MIDlet Class Name: com.mobilefish.m3g.Teapot4MIDlet

    Enter project details

    Press button "Create Project".

  4. Change the settings for this project:

    Tab: API Selection

    Target Platform: JTWI
    Configurations: CLDC 1.1
    Additional APIs: Mobile 3D Graphics for J2ME (JSR 184)

    Project setting: tab API selection.

    Tab: Required

    MIDlet-Vendor: (or choose any name you want).

    Project setting: tab Required.

    Tab: Optional

    MIDlet-Description: Teapot With Color and Texture Demo

    Project setting: tab Optional.

    Tab: User Defined

    no change

    Tab: MIDlets

    Icon: /icons/teapot.png

    Note: The image size is 12x12 px. The image looks like this: teapot 12x12 png file.

    Project setting: tab MIDlets.

    Tab: Push Registry

    no change

    Tab: Permissions

    no change

  5. Press OK button. The project is created.

    Project created.

  6. Close KToolbar, menu: File | Exit.

  7. You must manually create the icons directory: C:\Tools\WTK22\apps\Teapot4M3G\res\icons

  8. Download the following 4 files:
  9. The downloaded files must be copied to the following toolkit directories:

    • Copy and into C:\Tools\WTK22\apps\Teapot4M3G\src\com\mobilefish\m3g

    • Copy teapot4_background.m3g into C:\Tools\WTK22\apps\Teapot4M3G\res

    • Copy teapot.png into C:\Tools\WTK22\apps\Teapot4M3G\res\icons

  10. Start KToolbar and press button "Open Project".

    Open project.

  11. Select project "Teapot4M3G" and press button "Open Project".

    Project selected.

  12. Select the Device. In this example the default device "DefaultColorPhone" is used.

  13. Press button "Build" and if no errors are shown, press button "Run".

    M3G teapot

    Use the forward, back, left and right button to move the camera.

    M3G teapot moved

  14. Close KToolbar, menu: File | Exit

  15. To create an obfuscated package, you need the proguard.jar file.
    To get it do the following:

    • Go to
    • Select the "Download" link.
    • Select "Download section".
    • Choose the latest version of and save it to yours disk.
    • Extract the proguard.jar file from into the bin subdirectory of the WTK.

  16. Start KToolbar and open project Teapot4M3G.

  17. Now you can create an obfuscated package.
    Select menu: Project | Package | Create Obfuscated Package.

    Create obfuscated package

  18. During build the following messages are displayed:

    Create obfuscated package messages

  19. The Teapot4M3G.jar and Teapot4M3G.jad can be found in C:\Tools\WTK22\apps\Teapot4M3G\bin