javablackberrybitmapblackberry-eclipse-pluginblackberry-jde

Blackberry App - Bitmap Picture not showing


I have a feeling it has to do with the image path, that it isnt detecting the image. I am new to blackberry development.

The application runs but the image doesnt show. Maybe the image isnt positioned correctly?

public final class Welcome extends MainScreen
{
    /**
     * Creates a new Welcome object
     */
    public Welcome()
    {        
        // Set the displayed title of the screen       
        setTitle("Select a brand");

        Bitmap bitmapImage = Bitmap.getBitmapResource("/BrowserBlackberry/res/img/Celsian.jpg");
        BitmapField fieldDemo = new BitmapField(bitmapImage);    
        fieldDemo.setBorder(150,getBorder(20));
        fieldDemo.getBackground(Background.POSITION_X_CENTER);

        add(fieldDemo);
    }
}

Solution

  • try this

     public Welcome()
    {        
        // Set the displayed title of the screen       
        setTitle("Select a brand");
    
        Bitmap bitmapImage = Bitmap.getBitmapResource("Celsian.jpg");
        BitmapField fieldDemo = new BitmapField(bitmapImage);    
        add(fieldDemo);
    
    }