Learning from j2-start Development

Source: Internet
Author: User
I used to get a little JAVA a long time ago. Now I think it's time to cross the river by feeling the stones.
In this part, the function of reading books on mobile phones should be implemented in the form of jar and then published and run on the mobile phone. You can flip pages, set bookmarks, and set fonts.

// Joymobook v1.0 by freemobile
// Www.joymo.cn; www.iiwap.net

Import java. io. IOException;
Import javax. microedition. lcdui .*;
Import javax. microedition. midlet. MIDlet;
Import javax. microedition. midlet. MIDletStateChangeException;

Public class JoymoBookFrm extends MIDlet
Implements CommandListener

Private Display dsp;
Private Form frm;
Private Command lateral view;
Private Command cmdExit;
Private Image img;

Public JoymoBookFrm ()

Public final void startApp ()
Throws MIDletStateChangeException
Dsp = Display. getDisplay (this );
Lateral view = new Command ("reading", 4, 1 );
CmdExit = new Command ("quit", 7, 2 );
Frm = new Form (" -joymo.cn"); // www.joymo.cn
Img = Image. createImage ("/Java.png ");
Catch (IOException _ ex ){}
ImageItem imageitem = new ImageItem ("\ n", img, 3, "Image Cannot be shown ");
Frm. append (imageitem );
StringItem si = new StringItem (null, "[title] Test \ n" + "[author] freemobile \ n [production] \ n [description] the designer of this software is freemobile, QQ: 19149653. \ n Internet access: joymo.cn \ nWAP access: iiwap.net ");
Frm. append (si );
Frm. addCommand (lateral view );
Frm. addCommand (cmdExit );
Frm. setCommandListener (this );
Dsp. setCurrent (frm );

Public final void pauseApp ()

Public final void destroyApp (boolean flag)
Throws MIDletStateChangeException

Public final void commandAction (Command command, Displayable displayable)
If (command = cmdExit)
Yydestroyed ();

// Begin to view the book
// If (command = lateral view)
// Transfer the reading process to Alibaba Cloud, and use specialized classes to implement --www.iiwap.net

In reality, the software's logoas on the screen is a java.png image. The interface looks professional.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.