Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    I am developing J2ME app using NetBeans; I am created one List of menu using 'List' control. In that list there is a one menu named as Map. For this Map menu, I want to add an icon. I tried to do this & code is -

    Code:
    Image Mainlistmap;
    try
    {
            Mainlistmap = Image.createImage("/src/map.png");
    }
    catch(Exception ex)
    {
            System.out.println(ex.getMessage());
    }
    I have stored my entire project in following ditectory- E:\MScIT Part 2\MobileLocationReminder
    MobileLocationReminder folder is project folder contains all the stuffs of project such as src folder, dist folder, build folder, nbproject folder, build.xml file

    I have stored icon in src folder of & icon name is map.png and size is 30X33.

    I want to display a map.png icon to Map menu in the list.... but after doing all these things it is not giving me a desired result.

    Then Where do i store an image icon to access my project correctly & what path should be given to access an image in project????

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,747
    You may want to look inside the resulting .jar file, if it contains map.png anywhere or not. (.jar files are actually using .zip format)

  3. #3
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    @ wizard_hu_ :

    Yess it is present in .jar file. So now?? what should I do????

  4. #4
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,917
    Are you getting Exception ??

    if yes try - Mainlistmap = Image.createImage("/map.png");
    thanks,
    ~Amitabh
    (Poster of the Month -Dec'12)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    @im2amit :- That means i have to keep an icon outside the src folder along with other folders..... right????? even i did it before many time...... But never mind..... if you are saying then I will do that again.....

  6. #6
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    @im2amit :- Nothing happened....... problem still persist.......

  7. #7
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,747
    Do you get an exception after all? What does it say?

  8. #8
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,917
    Are you getting file no found exception - if yes check - the filename its case sensitive and Mainlistmap = Image.createImage("/map.png"); keeping the map.png in scr folder only.

    At time if you open and save the file back using Paint in windows system it might be named as Map.png or map.PNG.... it to be exact in your code as your file system i.e. inside the jar
    thanks,
    ~Amitabh
    (Poster of the Month -Dec'12)
    Follow me on my blog for Innovative Mobile Apps

  9. #9
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    Quote Originally Posted by wizard_hu_ View Post
    Do you get an exception after all? What does it say?
    Yes it is throwing an exception as null which is printed on bottom side output Window of Netbeans but it doesn't halt execution....

  10. #10
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    Quote Originally Posted by im2amit View Post
    Are you getting file no found exception - if yes check - the filename its case sensitive and Mainlistmap = Image.createImage("/map.png"); keeping the map.png in scr folder only.

    At time if you open and save the file back using Paint in windows system it might be named as Map.png or map.PNG.... it to be exact in your code as your file system i.e. inside the jar
    No I am not getting FileNotFoundException.... but I am getting null value which is printed on bottom side Output Window where program execution activity we can see.
    Last edited by Rahul More; 2012-12-21 at 09:31.

  11. #11
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    @ im2amit :- Sir........ I did accordingly whatever you said in second and first suggestion. And problem is solved. Thanx a lot Amitabh Sir for your support and Golden value suggestions..... keep on supporting like that....... Take care....
    Last edited by Rahul More; 2012-12-21 at 09:52.

  12. #12
    Registered User Rahul More's Avatar
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79
    @wizard_hu_ :- Sir...... my problem got solved...... Thanx to take interest in my problem and suggest me. Keep on supporting like that..... I need your suggestions...... Thank you sir......

Similar Threads

  1. Replies: 2
    Last Post: 2011-05-06, 14:43
  2. Implicit List and Tickers
    By am11 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2010-01-24, 13:12
  3. Making an item in an implicit list disabled
    By jaazz in forum Mobile Java General
    Replies: 1
    Last Post: 2006-08-02, 23:38
  4. problem with list.IMPLICIT
    By rathikathangaraj in forum Mobile Java General
    Replies: 2
    Last Post: 2005-06-23, 07:23
  5. Implicit List problem in series 60 emulator
    By jean_mountford in forum Mobile Java General
    Replies: 0
    Last Post: 2002-07-05, 19:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved