Hichem-elAbassi / j4me

Automatically exported from code.google.com/p/j4me
0 stars 0 forks source link

List class #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

Im developing a J2ME application with J4ME lib, I want my application to
have list choices where users can select their specific on that list, the
problem is that, J4ME componets doesn't a List class. any solution on how
that problem can be implemented?

Original issue reported on code.google.com by mokonejm@gmail.com on 28 Oct 2009 at 9:12

GoogleCodeExporter commented 9 years ago
just create a component which extends a radio button 

shown a example--->

import javax.microedition.lcdui.Graphics;

import org.j4me.ui.Theme;
import org.j4me.ui.components.RadioButton;

public class RadioButtonComponent extends RadioButton{

    public RadioButtonComponent ()
    {
        super();
    }

    protected void paintComponent (Graphics g, Theme theme, int width, int height, boolean selected)
    {
        super.paintComponent(g, theme, width, height, selected);
        //g.fillTriangle(206,23,211,30,216,23);//only work in 240X320
        int getWidth = getWidth()+16; //exact width of the screen
        g.fillTriangle(getWidth-34,23,getWidth-29,30,getWidth-24,23);//will work in any resolution
    }
}

Original comment by pradeep....@gmail.com on 15 Nov 2010 at 6:36