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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:32:20+00:00 2026-05-27T01:32:20+00:00

i have written a class which implements ListFieldCallBack like, import java.util.Vector; import net.rim.device.api.ui.Graphics; import

  • 0

i have written a class which implements ListFieldCallBack like,

import java.util.Vector;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.ListField;
import net.rim.device.api.ui.component.ListFieldCallback;


    class ListCallBack implements ListFieldCallback
    {
        private Vector listelements = new Vector();

        public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width) 
        {
            String text = (String)listelements.elementAt(index);
            graphics.drawText(text,0,y,0,width);
        }

        public Object get(ListField listField, int index) 
        {
            return listelements.elementAt(index);
        }

        public int indexOfList(ListField listField, String prefix, int start) 
        {
            return listelements.indexOf(prefix, start);
        }

        public int getPreferredWidth(ListField listField) 
        {
            return Graphics.getScreenWidth();
        }

        public void insert(String toInsert, int index)
        {
            listelements.addElement(toInsert);
        }   
        public void erase()
        {
            listelements.removeAllElements();
        }   
    }   

And in my constructor having the main class is coded as

helloWorld()
{
    mylist = new ListField();
    ListCallBack myCallBack = new ListCallBack();
    mylist.setCallback(myCallBack);
    for(int i = 0; i<array.length;i++)//array is a string array
    {
        list_category.insert(i);
        myCallBack.insert(array[i], i);
    }
    this.add(list_category);
}

this works properly..

like, i am getting output like,

Aby
Eric
Allay
vine

But i want to add another string to the next of that array in the each row displayed in list.. How could i do this?

Like, for example, i want my screen output like,

Aby     :  Smart
Eric    :  0000
Allay   :  9789
vine    :  Like

how could i do 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-27T01:32:21+00:00Added an answer on May 27, 2026 at 1:32 am

    You should change the ListFieldCallback.drawListRow(ListField listField, Graphics graphics, int index, int y, int width) to draw that.

    Use net.rim.device.api.ui.Graphics API to draw whatever you want.

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

Sidebar

Related Questions

I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl
I have written the following class which implements(or tries to!) a dictionary with notifications:
I have written an NHibernateSessionFactory class which holds a static Nhibernate ISessionFactory. This is
I have a class written in c# which is acting as a wrapper around
I have written a class in python that implements __str__(self) but when I use
I have written my Container<T> class which backups its T items in several collections
I have an interface Tree and an abstract class RBTree which implements this interface.
I have written the following class: public class SortingObjectsWithAngleField implements Comparator<Point> { public int
I have written the following code: public class NewClass2 implements Comparator<Point> { public int
I have written a variant class, which will be used as the main type

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.