易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

java冒泡排序!

int temp;
int [] arr=new int[];
for(int i=0;i<arr.length;i++)
{
    for(int j=0;j<arr.length-i-1;j++)
    {
         if(arr[j]<arr[j+1])
          {
   & ......

Axis2 java WebServices开发三POJO

环境JDK1.5
Eclipse 3.2
直接上代码:如果没有配置好环境请参看前两篇日志
服务器端代码
User类:
/*
*Class User.java
*Create Date: 2009-11-4
*Author:a276202460
*/
package com.axis.pojo.test;
public class User implements java.io.Serializable{
public boolean equals(Object obj) {
if (obj == ......

java中如何把一个目录下的文件移到另一个指定目录中

 import java.io.*;
public class FileToFile
{
 public static void main(String[] args)
 {
   File fold = new File("e:\\java\\file.java");//某路径下的文件
   String strNewPath = "e:\\java\\new file\\";//新路径
   File fnewpath = new File(strNewPath); ......

java删除文件夹

    1. package book.io;  
   2.  
   3. import java.io.File;  
   4.  
   5. /** 
   6.  *  
   7.  * @author XWZ 
   8.  * 20 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号