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
Developer
CBissonnette
Posts: 50
Registered: ‎10-09-2009
My Device: 9900
My Carrier: Bell
Accepted Solution

PictureScrollField.ScrollEntry problem

Hi,

I am trying to use a PictureScrollField.  The code seems fine but don't want to compile.  The error I got is:  cannot find symbol and point to the PictureScrollField.ScrollEntry[4]; part of the code.  Can someone help me with this?

 

Here is the code sample:

 

        Bitmap img1 = Bitmap.getBitmapResource("img1.gif");
        Bitmap img2 = Bitmap.getBitmapResource("img2.gif");
        Bitmap img3 = Bitmap.getBitmapResource("img3.gif");
        Bitmap img4 = Bitmap.getBitmapResource("img4.gif");
        
        PictureScrollField.ScrollEntry[] se = PictureScrollField.ScrollEntry[4];
        
        se[0] = new ScrollEntry(img1, "lbl_img1", "callout_img1");
        se[1] = new ScrollEntry(img2, "lbl_img2", "callout_img2");
        se[2] = new ScrollEntry(img3, "lbl_img3", "callout_img3");
        se[3] = new ScrollEntry(img4, "lbl_img4", "callout_img4");
        
        
        PictureScrollField pict = new PictureScrollField(100, 100);
        
        pict.setData(se, 2);
        
        pict.setHighlightStyle(HighlightStyle.ILLUMINATE);
        pict.setHighlightBorderColor(Color.RED); 
        pict.setBackground(BackgroundFactory.createSolidBackground(Color.LIGHTBLUE));
        pict.setLabelsVisible(true);
        
        _manager.add(pict);

 

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1154, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: PictureScrollField.ScrollEntry problem

You forgot the "new" keyword.

 

It says:

PictureScrollField.ScrollEntry[] se = PictureScrollField.ScrollEntry[4];

It should say:

PictureScrollField.ScrollEntry[] se = new PictureScrollField.ScrollEntry[4];
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.