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 484123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:16:03+00:00 2026-05-13T01:16:03+00:00

I want to customize a ListField in BlackBerry which would be able to list

  • 0

I want to customize a ListField in BlackBerry which would be able to list an image and text in a row.

How to accomplish this?

  • 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-13T01:16:03+00:00Added an answer on May 13, 2026 at 1:16 am

    Try something like this:

    class TaskListField extends ListField implements ListFieldCallback {
     private Vector rows;
     private Bitmap p1;
     private Bitmap p2;
     private Bitmap p3;
    
     public TaskListField() {
      super(0, ListField.MULTI_SELECT);
      setRowHeight(80);
      setEmptyString("Hooray, no tasks here!", DrawStyle.HCENTER);
      setCallback(this);
    
      p1 = Bitmap.getBitmapResource("1.png");
      p2 = Bitmap.getBitmapResource("2.png");
      p3 = Bitmap.getBitmapResource("3.png");
    
      rows = new Vector();
    
      for (int x = 0; x < 10; x++) {
       TableRowManager row = new TableRowManager();
    
       // SET THE PRIORITY BITMAP FIELD
       // if high priority, display p1 bitmap
       if (x % 2 == 0) {
        row.add(new BitmapField(p1));
       }
       // if priority is 2, set p2 bitmap
       else if (x % 3 == 0) {
        row.add(new BitmapField(p2));
       }
       // if priority is 3, set p3 bitmap
       else {
        row.add(new BitmapField(p3));
       }
    
       // SET THE TASK NAME LABELFIELD
       // if overdue, bold/underline
       LabelField task = new LabelField("Task #" + String.valueOf(x),
         DrawStyle.ELLIPSIS);
       // if due today, bold
       if (x % 2 == 0) {
        task.setFont(Font.getDefault().derive(
          Font.BOLD | Font.UNDERLINED));
        System.out.println("OVERDUE");
       } else {
        task.setFont(Font.getDefault().derive(Font.BOLD));
        System.out.println("TODAY");
       }
    
       row.add(task);
    
       // SET THE LIST NAME
       row.add(new LabelField("List Name #" + String.valueOf(x),
         DrawStyle.ELLIPSIS) {
        protected void paint(Graphics graphics) {
         graphics.setColor(0x00878787);
         super.paint(graphics);
        }
       });
    
       // SET THE DUE DATE/TIME
       row.add(new LabelField("Due Date #" + String.valueOf(x),
         DrawStyle.ELLIPSIS | LabelField.USE_ALL_WIDTH
           | DrawStyle.RIGHT) {
        protected void paint(Graphics graphics) {
         graphics.setColor(0x00878787);
         super.paint(graphics);
        }
       });
       rows.addElement(row);
      }
      setSize(rows.size());
    
     }
    
     // ListFieldCallback Implementation
     public void drawListRow(ListField listField, Graphics g, int index, int y,
       int width) {
      TaskListField list = (TaskListField) listField;
      TableRowManager rowManager = (TableRowManager) list.rows
        .elementAt(index);
      rowManager.drawRow(g, 0, y, width, list.getRowHeight());
     }
    
     private class TableRowManager extends Manager {
      public TableRowManager() {
       super(0);
      }
    
      // Causes the fields within this row manager to be layed out then
      // painted.
      public void drawRow(Graphics g, int x, int y, int width, int height) {
       // Arrange the cell fields within this row manager.
       layout(width, height);
    
       // Place this row manager within its enclosing list.
       setPosition(x, y);
    
       // Apply a translating/clipping transformation to the graphics
       // context so that this row paints in the right area.
       g.pushRegion(getExtent());
    
       // Paint this manager's controlled fields.
       subpaint(g);
    
       g.setColor(0x00CACACA);
       g.drawLine(0, 0, getPreferredWidth(), 0);
    
       // Restore the graphics context.
       g.popContext();
      }
    
      // Arrages this manager's controlled fields from left to right within
      // the enclosing table's columns.
      protected void sublayout(int width, int height) {
       // set the size and position of each field.
       int fontHeight = Font.getDefault().getHeight();
       int preferredWidth = getPreferredWidth();
    
       // start with the Bitmap Field of the priority icon
       Field field = getField(0);
       layoutChild(field, 32, 32);
       setPositionChild(field, 0, 0);
    
       // set the task name label field
       field = getField(1);
       layoutChild(field, preferredWidth - 16, fontHeight + 1);
       setPositionChild(field, 34, 3);
    
       // set the list name label field
       field = getField(2);
       layoutChild(field, 150, fontHeight + 1);
       setPositionChild(field, 34, fontHeight + 6);
    
       // set the due time name label field
       field = getField(3);
       layoutChild(field, 150, fontHeight + 1);
       setPositionChild(field, preferredWidth - 152, fontHeight + 6);
    
       setExtent(preferredWidth, getPreferredHeight());
      }
    
      // The preferred width of a row is defined by the list renderer.
      public int getPreferredWidth() {
       return Graphics.getScreenWidth();
      }
    
      // The preferred height of a row is the "row height" as defined in the
      // enclosing list.
      public int getPreferredHeight() {
       return getRowHeight();
      }
     }
    
     public Object get(ListField listField, int index) {
      return null;
     }
    
     public int getPreferredWidth(ListField listField) {
      return 0;
     }
    
     public int indexOfList(ListField listField, String prefix, int start) {
      return 0;
     }
    
    }
    

    See code from rtm4bb – A BlackBerry Client for Remember the Milk:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to customize a ListField in BlackBerry? Hi Friend's i want to
I want to customize ToolStripMenuItem by overriding OnPaint function. This is a MyToolStripMenuItem: public
I want to customize my own progress bar thru image view. I want to
i want to customize the error pages in Symfony 2.0 I know that this
I want to customize the way the text is rendered in Microsoft's Visual Studio
I want to customize next/previous posts links pagination to this structure: <!--PAGINATION--> <a href=#prev_post_link#
I want to customize Edit Field like in this link http://www.hostingpics.net/viewer.php?id=44669634im.png . I find
I want to customize the default error message This field is required when using
I want to customize my own media player, but I would rather do it
SALAM I want to customize the html text, buttons and text fields with CSS

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.