From where I can get the original source code of javax.macromedia.lcdui.List
I am using netbeans Editor.
http://www.j2medev.com/api/midp/java...cdui/List.html
I got this but it is showing error.
http://www.java2s.com/Open-Source/Ja.../List.java.htm
From where I can get the original source code of javax.macromedia.lcdui.List
I am using netbeans Editor.
http://www.j2medev.com/api/midp/java...cdui/List.html
I got this but it is showing error.
http://www.java2s.com/Open-Source/Ja.../List.java.htm
What do you mean by "original" source code?
Why do you want it? What problem are you trying to solve?
There is no "standard" source code... the List object on a Nokia device, for example, is not built from the same source code a List on a Sony Ericsson.
Graham.
So that means when I use javax.macroedition.lcdui.List then I am using Nokia's implementation of List not the Sun's or J2ME's.
Actually I want to create my own List, I got from documentation the List is extending screen. So I thought to extend Screen and created MyList class. But Screen was having several abstart methods so I planned instead of writing code for each and every method why shouldn't I use already existing code. But I was not able to find the right one which will compile with the sdk. So can you tell me the location of that List class ?
If you look at the documentation for the Screen class, you will see that there are no abstract methods that are public or protected. As such, you cannot extend this class with your own code.
If you want to build your own Displayable component, you need to extend Canvas, implementing the paint() method, and overriding methods like keyPressed().
Graham.
I successfully extended that screen using same package name. But as there are several abstract methods so I don't know how they should be handled. For that I need source of List class. Starting from canvas will increase my work. I don't know how can I make a checkbox on canvas then how I will be able to handle whole list of checkboxes.
Do you know where the source of List is ? Please give me source first, we will continue our discussion on this.
Thanks,
Rahul Kulshreshtha
You cannot create a class in the same package as the system classes. If you do, your application will not install on the phone. This is a mandatory security restriction of all CLDC devices.
I'm afraid it is not possible to do what you want - you must extend Canvas.
Consider using a UI library like LWUIT.
Graham.
I tried with that already. They are having List control but that List can only show Text as it's list element. We can not show checkbox in that List.
Actually my requirement is simple but I think either j2me is still not developed properly for nokia phones or I am still a child in this.
I want a screen with a list of checkboxes (obviously with scrolling feature) and one searchbox (that will be a textField) but after 1 week I am still not getting any hope to do it. Am I asking a hard problem ?
Is the canvas last hope ????
It's not a problem with Nokia's implementation, nor with you... MIDP just doesn't provide this kind of UI component. MIDP's built-in UI components are very basic, which is why libraries like LWUIT exist.
Yes, realistically, you must subclass Canvas to do this.
You should be able to do this with LWUIT. I'm not an expert in LWUIT, but perhaps using a form with checkboxes you could construct the kind of component you want. Much easier than building it from scratch. (LWUIT screens are all built from Canvas.) Or look for other libraries - there is a list on the wiki, I think.
Graham.
Thanks a lot Graham, you are the only one who replied till end of the discussion otherwise other peoples were just moving away by saying "this is not possible... etc etc" in my other threads
I will surely go for canvas and LWUIT library.
Thanks Again,
Rahul Kulshreshtha