(keitai-l) Re: Creating new DoJa UI Components

From: Jason Pollard <jasonpollard_at_yahoo.com>
Date: 09/17/03
Message-ID: <20030917162245.11688.qmail@web9903.mail.yahoo.com>
--- Sam Joseph <gaijin@yha.att.ne.jp> wrote:
> 
> Reto Grob wrote:
> 
> >>Since the com.nttdocomo.ui.Component paint() method is private to the 
> >>com.nttdocomo.ui package I can't override it by creating my "Gauge 
> >>extends Component" in another package, such as com.neurogrid.ui
> >>    
> >>
> >
> >How do you know that it is Component.paint()? Did you just try it out
> >and it worked on the emulator or some phones?
> >
> It worked on the emulator - I mean when I compile something with 
> paint(Graphics) in eclipse, if  am in the same package as 
> com.nttdocomo.ui then it compiles fine, if I am in a different package 
> then I get a warning about how this method is not accessible outside the 
> package and so can't be overridden.
> 
That's probably because the implementation base Components extend the java
swing component, which has a paint() method.  I-Jade's does.  Best to stick to
the public API's, because on each device that paint() method could be something
else.

> >
> Well it won't work on any phones at the moment as far as I can see cos I 
> can't have a com.nttdocomo.ui.Gauge class cos I'm forbidden to create 
> something in that package.
> 
I think I went thru this same thing about a year and a half ago.  After giving
up on making my own components, I got help from this list in trying to
implement a custom classloader, which I was going to use to download new UI
classes over the network.  That can't be done either, in case you were
wondering. :-(

I think they must have done this to reduce the complexity of the
API/Implementations, as well as reduce the size of iAppli code.  Even just to
paint a basic button, you need 4 lines, background color fill, and text, which
you could do only if you could paint on the Display.  Yeah, sometimes it seems
they went out of their way to make things difficult for developers.  My guess
is that J2ME isn't long for this world, and that we'll have a standard J2SE JVM
on most devices within 3 years that would maybe have a limited UI toolkit.

--jason


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Received on Wed Sep 17 19:21:38 2003