Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

09 Display

717 vues

Publié le

Publié dans : Technologie, Formation
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

09 Display

  1. 1. Display Cornelius Koo – 2005 cornelius.mellino@gmail.com
  2. 2. What is Display• The Display object working just like a manager of the display controlling what is shown on the device and when.• javax.microedition.lcdui.Display
  3. 3. How to Get• Display object is made available to MIDlet through a call to static method declared inside the Display class.• The reference is often held for a lifetime of MIDlet.
  4. 4. public class HelloWorld extends MIDlet { private Display display; public HelloWorld() { super(); display = Display.getDisplay(this); }…
  5. 5. Display API
  6. 6. Example MIDlet : TestDisplay.java
  7. 7. Displayable
  8. 8. The Rules• There is only one Display object per MIDlet.• Display object can show any number of Displayable objects.
  9. 9. There are two class that extends Displayable. Those areCanvas and Screen classes.
  10. 10. Creating Displayable Class1. Extends Canvas class directly.2. Use subclasses of Screen.3. Extends from subclasses of Screen.
  11. 11. Extends Canvas Class Directlypublic class MyOwnScreen extends Canvas{ Drawing something…}
  12. 12. Use Subclasses of ScreenTextBox t = new TextBox( "Hello World MIDlet", "Hello Small World", 256, 0);...display.setCurrent(t);
  13. 13. Extends From Subclasses of Screenpublic class MyForm extends Form { }
  14. 14. Displayable APIExample MIDlet : TestDisplayable.java
  15. 15. Reference• Core J2ME Technology and MIDP. John W. Muchow. Prentice Hall PTR, 2002.• Enterprise J2ME: Developing Mobile Java Applications. Michael Juntao Yuan. Prentice Hall PTR, 2003.• J2ME in A Nutshell. Kim Topley. Oreilly, 2002.

×