Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 780679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:06:48+00:00 2026-05-14T20:06:48+00:00

I’m having an interesting anomaly when displaying a listfield on the blackberry simulator: The

  • 0

I’m having an interesting anomaly when displaying a listfield on the blackberry simulator:

The top item is the height of a single line of text (about 12 pixels) while the rest are fine.
Does anyone know why only the top item is being drawn this way? Also, when I add an empty venue in position 0, it still displays the first actual venue this way (item in position 1).

Not sure what to do.
Thanks for any help.

The layout looks like this:

-----------------------------------
| *part of image* | title         |
-----------------------------------
|                 | title         |
| * full image *  | address       |
|                 | city, zip     |
-----------------------------------

The object is called like so:

listField = new ListField( venueList.size() );
listField.setCallback( this );
listField.setSelectedIndex(-1);
_middle.add( listField );

Here is the drawListRow code:

public void drawListRow( ListField listField, Graphics graphics, 
    int index, int y, int width ) 
{

    listField.setRowHeight(90);
    Hashtable item = (Hashtable) venueList.elementAt( index );
    String venue_name = (String) item.get("name");
    String image_url = (String) item.get("image_url");
    String address = (String) item.get("address");
    String city = (String) item.get("city");
    String zip = (String) item.get("zip");
    EncodedImage img = null;

try 
    {
        String filename = image_url.substring(image_url.indexOf("crop/") 
            + 5, image_url.length() );
        FileConnection fconn = (FileConnection)Connector.open( 
            "file:///SDCard/Blackberry/project1/" + filename, 
            Connector.READ);            
        if ( !fconn.exists() )
        {

        }
        else
        {
            InputStream input = fconn.openInputStream();

            byte[] data = new byte[(int)fconn.fileSize()];
            input.read(data);
            input.close();
            if(data.length > 0)
            {
                EncodedImage rawimg = EncodedImage.createEncodedImage(
                    data, 0, data.length);                  
                int dw = Fixed32.toFP(Display.getWidth());
                int iw = Fixed32.toFP(rawimg.getWidth());
                int sf = Fixed32.div(iw, dw);
                img = rawimg.scaleImage32(sf * 4, sf * 4);
            }
            else
            {

            }
        }
}
catch(IOException ef)
{                

} 

   graphics.drawText( venue_name, 140, y, 0, width );
   graphics.drawText( address, 140, y + 15, 0, width );
   graphics.drawText( city + ", " + zip, 140, y + 30, 0, width );
   if(img != null)
   {
       graphics.drawImage(0, y, img.getWidth(), img.getHeight(), 
           img, 0, 0, 0);
   }    
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:06:49+00:00Added an answer on May 14, 2026 at 8:06 pm

    setRowHeight should be called once after construction of ListField, not inside of drawListRow on each time row is repainted:

    listField = new ListField( venueList.size() );
    listField.setRowHeight(90);
    listField.setCallback( this );
    listField.setSelectedIndex(-1);
    _middle.add( listField );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm trying to create an if statement in PHP that prevents a single post
I have a reasonable size flat file database of text documents mostly saved in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.