📄 fileconnectiondemomidlet.java
字号:
/*****************************************************************************
Description: FileConnectionDemoMidlet
* The FileConnectionDemoMidlet is the MIdlet class of this program and from here you can browse
* and view the fileSystem
Created By: Johan Kateby
@file FileConnectionDemoMidlet.java
COPYRIGHT All rights reserved Sony Ericsson Mobile Communications AB 2004.
The software is the copyrighted work of Sony Ericsson Mobile Communications AB.
The use of the software is subject to the terms of the end-user license
agreement which accompanies or is included with the software. The software is
provided "as is" and Sony Ericsson specifically disclaim any warranty or
condition whatsoever regarding merchantability or fitness for a specific
purpose, title or non-infringement. No warranty of any kind is made in
relation to the condition, suitability, availability, accuracy, reliability,
merchantability and/or non-infringement of the software provided herein.
*****************************************************************************/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class FileConnectionDemoMidlet extends MIDlet implements CommandListener {
// used for viewing the filesystem and images
private FileBrowsingCanvas filebrowser;
private Command selectCommand;
public static Display display;
private Displayable current;
private List options;
// The camera form which we use to take snapshots
private CameraForm cameraform;
public FileConnectionDemoMidlet()
{
selectCommand = new Command("Select", Command.ITEM, 1);
options = new List("OPTIONS", List.IMPLICIT);
options.append("Browse Images",null);
options.append("Take a photo",null);
options.append("EXIT",null);
options.setSelectCommand(selectCommand);
options.setCommandListener(this);
options.addCommand(selectCommand);
cameraform = new CameraForm(options);
current = options;
}
public void startApp() {
if(display==null)
display = Display.getDisplay(this);
display.setCurrent(current);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable s){
int index= options.getSelectedIndex();
switch (index)
{
case 0:
current= new FileBrowsingCanvas(options,FileBrowsingCanvas.TYPE_IMAGE_BROWSER);
display.setCurrent(current);
break;
case 1:
display.setCurrent(cameraform);
break;
case 2:
this.notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -