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

  • Home
  • SEARCH
  • 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 1023383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:36:36+00:00 2026-05-16T11:36:36+00:00

I am new to Blackberry development.My application contain five list items having strings each

  • 0

I am new to Blackberry development.My application contain five list items having strings each item.My requirement is when one cell is selected it should enlarge and other items adjust space automatically among them.
I took two types of images for list items one for general view and one for displaying the selected item when user clicked on it which is of more height than previous.

But the problem is when I selected one item it is enlarging and overlapped on the next item and is not displaying full item and not adjusting the space among them.
can anyone give me the solution for this. I am using the following code snippet….

_listField.setCallback(this);
    _listField.setRowHeight(45);
    _listField.setChangeListener(this);

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

    if (listFieldIndex != index) {

        graphics.drawBitmap(0, y, listBkgrnd.getWidth(), listBkgrnd
                .getHeight(), listBkgrnd, 0, 0);

        graphics.setColor(0xAA0000);
        graphics.setFont(this.getFont().derive(Font.BOLD, 17));
        graphics.drawText(((Station) _stationList.elementAt(index))
                .getStationName(), 15, y + 15, 0,
                (listBkgrnd.getWidth() - 70));

        graphics.setColor(0x770000);
        graphics.setFont(this.getFont().derive(Font.PLAIN, 13));

        // graphics.drawText(
        // ((Station) _stationList.elementAt(index)).getCT(), 15,
        // y + 40, 0, (listBkgrnd.getWidth() - 65));

    } else {

        graphics.drawBitmap(0, y, playBkgrnd.getWidth(), playBkgrnd
                .getHeight(), playBkgrnd, 0, 0);

        graphics.setColor(0xAA0000);
        graphics.setFont(this.getFont().derive(Font.BOLD, 17));
        graphics.drawText(((Station) _stationList.elementAt(index))
                .getStationName(), 15, y + 15, 0,
                (playBkgrnd.getWidth() - 70));

        graphics.setColor(0x770000);
        graphics.setFont(this.getFont().derive(Font.PLAIN, 13));

        graphics.drawText(
                    s.getCT(), 15,
                    y + 40, 0, (playBkgrnd.getWidth() - 65));
    }
}
  • 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-16T11:36:37+00:00Added an answer on May 16, 2026 at 11:36 am

    List fields on BlackBerry assume that all rows are the same height.

    To get the kind of effect you want, use a bunch of selectable fields in a VerticalFieldManager, you’ll get a similar effect to a ListField. Be sure to make your items focusable, and call updateLayout whenever they gain or lose focus, then in your layout method, set the field’s height according to whether or not it’s focused. Something like the following outline:

    public class CustomListFieldItem extends Field {
    
        public boolean isFocusable() {
            return true;
        }
    
        protected void onFocus(int direction) {
            super.onFocus(direction);
            updateLayout();
        }
    
        protected void onUnfocus() {
            super.onUnfocus();
            updateLayout();
        }
    
        protected void layout(int width, int height) {
            if (isFocus()) {
                setExtent(width, playBkgrnd.getHeight());
            }
            else {
                setExtent(width, listBkgrnd.getHeight());
            }
    
        }
    
        protected void paint(Graphics graphics) {
            if (isFocus()) {
                // draw selected item
            }
            else {
                // draw unselected item
            }
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.