Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
bennyderickm
Posts: 9
Registered: ‎03-04-2009
My Device: Not Specified
Accepted Solution

Adding a logo to the appliction

I was trying to add the logo to my aplication.  When run the simulat it comes as blank.  Any suggestions:

 

Here is my code sample:

 

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.container.FullScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

/**
 *
 */

/**
 * @author kthiruka
 *
 */
public class TEST extends UiApplication{

    /**
     *
     */
    public TEST() {
        pushScreen(new TESTScreen());
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        TEST app = new TEST();
        app.enterEventDispatcher();
    }

}

class TESTScreen extends FullScreen {
   
    public TESTScreen() {
        VerticalFieldManager vfm = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL);
        Bitmap logo = Bitmap.getBitmapResource("logo.PNG");
        BitmapField logoField = new BitmapField(logo);
        vfm.add(logoField);
        add(vfm);
    }
}
 

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Adding a logo to the appliction

Did you add the image to your project?

 

Developer
Developer
bo
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: Adding a logo to the appliction

If you're using Eclipse I find I have to sometimes refresh /src/ to get the images to show up.  You should also see something in the console telling you it can't find the bitmap.
New Developer
bennyderickm
Posts: 9
Registered: ‎03-04-2009
My Device: Not Specified

Re: Adding a logo to the appliction

Hello RexDoug 

I did add image to the project and whech checked the project folder it is there in the main project folder.

New Developer
bennyderickm
Posts: 9
Registered: ‎03-04-2009
My Device: Not Specified

Re: Adding a logo to the appliction

bo

 

I find my picture in the project folder in the main root but i can't find in the eclipse envinronment even after refreshing it.

 

I used the import functionality on eclipse to bring the picture to the project. 

Developer
Developer
bo
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: Adding a logo to the appliction

Maybe try moving it to the /src directory using Windows explorer and then refreshing Eclipse?
New Developer
bennyderickm
Posts: 9
Registered: ‎03-04-2009
My Device: Not Specified

Re: Adding a logo to the appliction

thanks it works fine now