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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:25:01+00:00 2026-06-07T04:25:01+00:00

I have inserted a list in my j2ME project,designed using LWUIT. The code is

  • 0

I have inserted a list in my j2ME project,designed using LWUIT. The code is as follows

  Button btnHome;
  Button btnExit;
  List list;
  setScrollableY(false);
  setScrollable(false);

  list = new List();
  MyRenderer render = new MyRenderer();
  list.setListCellRenderer(render);         

       list.getStyle().setFgColor(0xfaedf2);
       list.setSmoothScrolling(true);     
       list.addSelectionListener(new SelectionListener(){
            public void selectionChanged(int i, int i1) {
            try {
            InformationForm form = new InformationForm();                                        
            form.show();
            } catch (IOException ex) {
                ex.printStackTrace();
            }


        }


        });

        String[] arrString  = builder.getArrName();
       System.out.println(arrString.length);
       for (int i = 0; i < arrString.length ; i++)
              {
               list.addItem(arrString[i]);
             // System.out.println("item no " + i +" = " +arrString[i] + "added in   list");
              }         

           BorderLayout bl=new BorderLayout();


setLayout(bl);
Container holdingContainer=new Container(new FlowLayout(Component.LEFT));
Container c0 = new Container(new BoxLayout(BoxLayout.X_AXIS));
Container c1 = new Container(new FlowLayout(Component.LEFT));
Container c2 = new Container(new FlowLayout(Component.LEFT));

Container footerContainer=new Container(new BoxLayout(BoxLayout.X_AXIS));

c0.addComponent(cityChoice);
c0.addComponent(btnFilter);


  //c2.addComponent(list);

  c1.setPreferredH(25);
  holdingContainer.addComponent(c0);
  holdingContainer.addComponent(c1);
  getStyle().setBgColor(0x730E36);
 // holdingContainer.addComponent(c2);
  holdingContainer.setPreferredH(280);
  holdingContainer.setScrollableY(true);

  addComponent(BorderLayout.CENTER,list);
  //addComponent(BorderLayout.WEST,holdingContainer);
  footerContainer.getStyle().setMargin(Component.LEFT, 0);
  footerContainer.addComponent(btnHome);
  footerContainer.addComponent(btnExit);

  addComponent(BorderLayout.SOUTH,footerContainer);

The renderer for list is,
public class MyRenderer extends TextArea implements ListCellRenderer{

 public Component getListCellRendererComponent(List list, Object value, int index,    boolean isSelected){
 getStyle().setBorder(Border.createEmpty());
 getStyle().setFgColor(0xfaedf2);
 getStyle().setBgColor(isSelected ? 0x630A2E : 0x730E36);

 setText(value.toString());

 if (isSelected) {
 setFocus(true);
 getStyle().setBgTransparency(100);
 } else {
 setFocus(false);
 getStyle().setBgTransparency(0);
 }
 return this;
 }
 public Component getListFocusComponent(List list){
   return null;}


 }

The problem is when on device, i try to scroll the list, the item on which i touched is selected immediatly and the new form for it is opened. I do not able to scroll the list at all. Please help me in solving this problem.

  • 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-06-07T04:25:03+00:00Added an answer on June 7, 2026 at 4:25 am

    Is it possible you are using a SelectionListener instead of an ActionListener?

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

Sidebar

Related Questions

I have created a project in Dashcode, inserted a List control, enabled a dynamic
I have inserted a code to display product attribute in view.phptml, which works fine.
i am using a website application for registration, in that application i have inserted
I have some code where I am using a Linq-To-SQL DataContext to add and
I have a list of list . All elements will be inserted at run-time.
I have a linked list of around 5000 entries (NOT inserted simultaneously), and I
I have a list of users which needs to be iterated using a foreach
I have a JQueryMobile button inserted inside the ListView. When the button is hard-coded
I have a JSP page that shows a list of new entries inserted on
I have inserted string and integer values into dynamic columns in a Cassandra Column

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.