Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA ME ÊÖ»ú³ÌÐòÈëÃż¶Ô´Âë

 Ò»¸öÓÉ Carol Hamer дµÄ±È½ÏÓдú±íÐÔµÄÔ´Â룬×÷ÕßÈ«Á¦ÍƼö£¬ÓÈÆäÊǶÔÓÚûÓÐ J2ME ¿ª·¢¾­ÑéµÄÅóÓÑ¡£×Ô¼º¶¯ÊÖÇóöÒÔÏÂÌù³öµÄ Hello.java ºÍ HelloCanvas.java Ô´Â룬²¢ÔËÐУ¬ÓÃÐÄÌå»áһϡ£ÏàÐÅÄãÀí½âÁË´ËÔ´ÂëÖ®ºó£¬¼´¿É²½Èë J2ME ¿ª·¢¡£
×¢ÊͶ¼ÔÚÔ´ÂëÀÔËÐл·¾³×Ô¼ºÅ䣬×Ô¼º¶¯ÊÖ¿´ÔËÐÐЧ¹û£¬Àí½âÖ®ºó£¬È»ºó¶¯ÊÖÐÞ¸ÄÒ»ÏÂÔ´Â룬J2ME ¿ª·¢£¬Äã¿ÉÒԵģ¡
Hello.java Ô´Â룺
package net.frog_parrot.hello;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
/**
* This is the main class of the hello world demo
*
* @author Carol Hamer
*
*/
public class Hello extends MIDlet implements CommandListener {

/**
* The canvas is the region of the screen that has bean alloted to the game
*/
HelloCanvas myCanvas;

/**
* The Command objects apears as buttons.
*/
private Command exitCommand = new Command("Exit",Command.EXIT,99);

/**
* The Command objects apears as buttons.
*/
private Command newCommand = new Command("Toggle Msg",Command.SCREEN,1);

/**
* initialize the canvas and the commands
*/
public Hello() {
myCanvas = new HelloCanvas(Display.getDisplay(this));
myCanvas.addCommand(exitCommand);
myCanvas.addCommand(newCommand);
myCanvas.setCommandListener(this);
}
//--------------------------------
// implementation of MIDlet

/**
* Start the application
*/
protected void startApp() throws MIDletStateChangeException {
myCanvas.start();
}

/**
* This method is called to notify the MIDlet to enter a paused state.
* The MIDlet should use this opportunity to release shared resources.
*/
protected void pauseApp() {
}

/**
* If the MIDlet was using resources,it should release them in this method
*/
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}

//-----------------------
// implementation of CommandListener.
/**
* Respond to a command issued on the Canvas
* (either reset or exit)
*/
public void commandAction(Co


Ïà¹ØÎĵµ£º

cookie¼¼ÊõÔÚJava MEƽ̨µÄÓ¦ÓÃÓëʵÏÖ

ת×Ô£º http://www.j2medev.com/Article/ShowArticle.asp?ArticleID=4465 
CookieÔÚWebÓ¦ÓóÌÐòÖб»¹ã·º²ÉÓã¬Î¬»¤ä¯ÀÀÆ÷ºÍ·þÎñÆ÷Ö®¼äµÄ״̬¡£Òź¶µÄÊÇÕâÒ»ÌØÐÔÔÚJava MEƽ̨Öв¢Ã»Óеõ½Ö§³Ö¡£Òò´Ë£¬ÒªÏëά³Ö¿Í»§¶ËºÍ·þÎñÆ÷¶ËµÄ״̬Ôò±ØÐëʹÓÃURLÖØÐ´µÄ·½Ê½¡£URLÖØÐ´²Ù×÷ÆðÀ´±È½ÏÂé·³£¬ËùÒÔÑо¿Ò»ÏÂcookieµÄÔ­Àí²¢ÔÚ ......

Java Card ¼¼Êõ(¶þ)

 
±¾ÏµÁÐÎÄÕÂµÄµÚ 1 ²¿·Ö½éÉÜÁË Java Card ¼¼ÊõµÄ¸ß¼¶ÖªÊ¶ —— ʲôÊÇÖÇÄÜ¿¨¡¢Java Card Ó¦ÓóÌÐòµÄÔªËØ¡¢Í¨ÐźͲ»Í¬ Java Card ¼¼Êõ¹æ·¶µÄ»ã×Ü¡£ÔÚ±¾²¿·ÖÖУ¬ÎÒÃǽ«Öصã½éÉÜ Java Card applet µÄ¿ª·¢£º¿ª·¢ Java Card Ó¦ÓóÌÐò¡¢Sun Java Card ¿ª·¢¹¤¾ßÏä¡¢Java Card ºÍ Java Card RMI API ʱËùÐèµÄÒ»°ã² ......

Java SE6 ϵͳÍÐÅÌСӦÓùþ

 /**
* @(#)MyTray.java
*
*
* @author Xie Xiaojin
* @version 1.00 2009/11/9
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MyTray implements ActionListener {
private MenuItem item1;
private MenuItem item2;
private MenuItem item3;
private ......

JAVAѧϰµÄÒ»Ð©ÖØµã


1. JavaÓïÑÔ»ù´¡
̸µ½JavaÓïÑÔ»ù´¡Ñ§Ï°µÄÊé¼®£¬´ó¼Ò¿Ï¶¨»áÍÆ¼öBruce EckelµÄ¡¶Thinking in Java¡·¡£ËüÊÇÒ»±¾Ð´µÄÏ൱Éî¿ÌµÄ¼¼ÊõÊé¼®£¬JavaÓïÑÔ»ù´¡²¿·Ö»ù±¾Ã»ÓÐÆäËüÈκÎÒ»±¾Êé¿ÉÒÔ³¬Ô½Ëü¡£¸ÃÊéµÄ×÷ÕßBruce EckelÔÚÍøÂçÉϱ»³ÆÎªÌì²ÅµÄͶ»úÕߣ¬×÷Õߵġ¶Thinking in C++¡·ÔÚ1995ÄêÔø»ñSoftwareDevelopment Jolt Award×î¼ÑÊ ......

javaµÝ¹éʵÀý

 example£º Çó5µÄ½×³Ë¡£¡£

ÈçÏ£º

public class Test {
static int multiply(int n){
if(n==1||n==0)
return n;
else
return n*multiply(n-1);
}

public static void main(String[] args){
System.out.println(multiply(10));
}
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ