adding icon to your MIDlet

Hello, this topic is also not very complicated, so the post will be quite short.
We have to remember about some rules before we add icon to a MIDlet:

  • Only PNG’s are allowed
  • icon’s size is not standarized
  • some phones will expand smaller icons, some won’t
  • the icons that are to big might be shrinked or cut to smaller, we can’t decide
  • I recommend using size 32×32, it is smaller than most phones can hold, so at least we can be sure, that it won’t be cut
  • icon files, if we want to reffer to it as: “/icon.png” should be placed in src directory in project’s path I think it’s the best way to do this (this file will be automatically added to newly created JAR file)
  1. After starting Netbeans we go as before to project’s properties, here we open “Application Descriptor” again, then we select second tab:
  2. Now, after choosing “Edit…” we can select file:
  3. Next, we have to add appropriate attribute to our JAD and manifest. Let’s click “Add…”, automatically first to add will be icon attribute:
  4. At last you can run this MIDlet in the emulator (or upload to your mobile). You should see icon you have selected for your app.