This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Display - Best practice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Display - Best practice" Watch "Display - Best practice" New topic
Author

Display - Best practice

Peter Miklosko
Ranch Hand

Joined: May 26, 2009
Posts: 76
What is best practice in handling movement from screen to screen in midlet?
My teacher at university wasn't able to explain this to me, could be due to that he chuck whole 300+ lines in one file.
Secondly none of the books or tutorials that I read so far went on discussing this.
So here is how I do it and I would like to know if my approach is correct and if not I would like to know how to handle this correctly.

ImageHttp.java


MainMenu.java


In my opinion this better solution then sending instance of Displayable argument to next class.
Amila Jayatillaka
Greenhorn

Joined: Sep 29, 2006
Posts: 28
Midlet Class


In displayable classes, I'll get a instance of this midlet through constructor. And i'll call getDisplay() where ever i need...


SCJP 1.4, SCMAD 1.0, SCWCD 5.0
Peter Miklosko
Ranch Hand

Joined: May 26, 2009
Posts: 76
I was recommended following approach




 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Display - Best practice
 
Similar Threads
null pointer exception
Nokia Emulator shuts itself down
New to J2ME and authorization failed message
Help with switching between forms
java.lang.NullPointerException - canot find why