×

Discussion Board

Results 1 to 3 of 3

Thread: CustomItem

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    8

    CustomItem

    Hello

    I have a n97mini.

    I want to do a midlet application with a list of items
    each item is like : one image on the left and 2 rows of text next to the image

    I use a CustomItem but when i slide my list, each item is a white rectangle

    this is in my midlet

    Code:
    for(int i=0;i<100;i++)
    {
    	lab1 = "haut " + i;
    	lab2 = "bas " + i;
    	VirtualList vl = new VirtualList(img, lab1, lab2, dis, longImage);
    	vl.setPrefContentHeight(50);
    	vl.setPrefContentWidth(200);
    	vl.setLayout(Item.LAYOUT_NEWLINE_AFTER);
    	form.append(vl);
    }
    dis.setCurrent(form);
    and this is in the paint of VirtualList.java ( who extends CustomItem )

    Code:
    int colText = _display.getColor(Display.COLOR_BACKGROUND);
    		
    		//texte
    		g.setColor(colText);
    		g.drawString(_labH, 60,0, Graphics.LEFT | Graphics.TOP);
    		g.drawString(_labB, 60,25, Graphics.LEFT | Graphics.TOP);
    		
    		//image
    		g.drawImage(_image, 0, 0, Graphics.LEFT | Graphics.TOP);
    I want to have the same thing like in Pictures of my phone

    Thanks to help me

    ( Sorry for my bad english )

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: CustomItem


  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    8

    Re: CustomItem

    Yes I do my code with this article

    but in this article if I draw the half of the rectangle like this :

    Code:
    g.fillRect( 0, y, width/2, height - y );
    I have the same problem

    When I draw a lot of items like this :

    Code:
    for(int i=0;i<100;i++)
    {
    	lab1 = "haut " + i;
    	lab2 = "bas " + i;
    	VirtualList vl = new VirtualList(img, lab1, lab2, dis, longImage);
    	vl.setPrefContentHeight(50);
    	vl.setPrefContentWidth(200);
    	vl.setLayout(Item.LAYOUT_NEWLINE_AFTER);
    	form.append(vl);
    }
    dis.setCurrent(form);
    }
    here I draw 100 items with the Virtual list but when I slide on my phone, there is a display problem

Similar Threads

  1. customItem
    By Arunesh in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2010-02-13, 14:35
  2. CustomItem not being painted
    By vipullal in forum Mobile Java Media (Graphics & Sounds)
    Replies: 7
    Last Post: 2009-07-03, 06:53
  3. CustomItem
    By dapabos in forum Mobile Java General
    Replies: 2
    Last Post: 2007-06-04, 07:51
  4. CustomItem
    By jinesh_l in forum Mobile Java General
    Replies: 1
    Last Post: 2005-11-09, 09:22
  5. CustomItem on Canvas
    By Ishmagel in forum Mobile Java General
    Replies: 12
    Last Post: 2004-07-20, 08:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •