Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why has this simple midlet stopped working?!!

 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a midlet which was working fine, but now gives the error, 'No such method getTitle.()Ljava/lang/String;'.

I have now created a very simple test midlet that includes the problematic line of code:



It is the line, 'dTitle = ((Screen)d).getTitle();' that is giving the error message. It happens both on Sun ONE Studio 4 and with JBuilder with Nokia and Siemens emulators.

Everything used to work fine. All I have done since it last worked is create a couple of JApplets and JFrame classes in Sun ONE Studio 4. I have noticed that the 'Explorer [Filesystems]' view in Sun ONE Studio 4 has changed in appearance since the midlet last worked, but there are no other clues.

It must be something to do with my setup rather than my code.

Can anyone please help!

Cheers,
James
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We've got a whole forum for J2ME issues here. I'm going to move your post over there, where it's more likely to get a reply.
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you compile the code using MIDP 2 library and try to run it in MIDP 1 emulators? In MIDP 2 the getTitle() method is moved to the Displayable class from the Screen class. Of course, the Screen class still inherits from Displayable. So, your code is still correct in both MIDP 1 and MIDP 2. I am just not sure whether the bytecode is still compatible.
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael for your reply,

I have solved the problem now, which seemed to lay with the compiler. It stopped working for some reason... Once I downloaded WTK104 again, and compiled with the new WTK104, it worked!

Not sure why it stopped working. The only unusual thing I had done prior to it going wrong was adding several emulator instances in SUN One Studio 4 - maybe it didn't like that.

Now I am trying to get it to go wrong again using the original WTK104 to try and nail what the exact cause was - but, predictably, it now seems to be working fine all the time!...
 
Zia Ahmed Shaikh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi;
It will work fine with wireless toolkit 1.0.4_01 or MIDP2.0fcs
zia.
ziaahmedshaikh@yahoo.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic