How to Add a Midlet Canvas in NetBeans

Written by breann kanobi
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Add a Midlet Canvas in NetBeans
Create a mobile phone game from your MIDlet canvas. (phone image by Eisenhans from Fotolia.com)

The computer program Netbeans allows users to create a wide variety of coding projects, including MIDlet canvas. A MIDlet canvas, a canvas for a mobile web game, sometimes called a GameCanvas, can be highly customised, depending on the type of game you wish to make. Programming a MIDlet game requires advanced knowledge of the Netbeans compatible programming language, C or C++. Any Netbeans program 5.5 or higher allows users to create a MIDlet canvas.

Skill level:
Moderate

Other People Are Reading

Instructions

  1. 1

    Open NetBeans by double-clicking on the icon.

  2. 2

    Click on the "File" menu. Scroll to "Create New." Select "Mobile Application Project" at the pop-up window. Uncheck the "Create Hello MIDlet" box and press "OK." Hold the keys "Control" and "N" at the same time. Click on the categories drop-down menu and select "MIDlet" and click on the "Package" field. Type "MyGame" and click the "Finish" button.

  3. 3

    Open the "File" menu and scroll to "New File." Click on the "Classes" drop down menu and select "Java Class." Press the "Next" button. Click on the "Class Name" text field and type "clsCanvas" then press the "Finish" button.

  4. 4

    Modify the code. Locate the code that reads "public class clsCanvas {" and add the text "GameCanvas implements Runnable" right after "clsCanvas."

  5. 5

    Add the code "import javax.microedition.lcdui.game.GameCanvas;" just above the line of code you edited.

Don't Miss

Resources

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.