• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

calling another class in src

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i m having problem of calling another class in src
for instant, i did create an implicit list to select items. Then each of the item should call another class.
this is what i did

private AnotherClass Variable;

Variable = new AnotherClass();
Variable.startApp();

suppost i expect it to go to another form ~but it never ~
please help me ~
 
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot call one MIDlet from another one. The life cycle methods (e.g., startApp()) are only called by the AMS.
 
kok seong chen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so how can i link Implicit list's to another form or function?
case 0:
???
help please ~
thks a lot ,michael yuan
 
Michael Yuan
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the commandAction method, you instaniate a new Form object (*not* MIDlet) and set it to display using display.setCurrent() method.
 
kok seong chen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry michael yuan ~
i don not understand what are u telling
can you please giv me some example?
i still don understand how to call another class
what i know is first declare
private ClassName variable;
second call constructor
variable = new Constructor();
thirdly call function ?
i donno which function to call
plz giv me example ~ or something ~
thks yuan
 
Michael Yuan
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Search "MIDlet hello world" on google gives you this example:
http://www.sonyericsson.com/developer/site/global/techsupport/tipstrickscode/java/p_howcreatejavamidlethelloworld.jsp
Notice how the MIDlet class uses the HelloCanvas class. A more complex example involving different threads etc can be found in the appendix of my book:
http://www.enterprisej2me.com/pages/enterprisej2me/codebrowser.php?req=//appendix01/SimpleDemo/src/com/enterprisej2me/simpledemo/DemoMIDlet.html
 
kok seong chen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thks michael~
btw i m trying to create some winamp player button on mobile phone.
Do you have any sample source of creating winamp player's button?
 
reply
    Bookmark Topic Watch Topic
  • New Topic