?? mmsform.java
字號:
/***************************************************************************** Description: this if a form used to add recipients to the mms Created By: Oscar Vivall 2005-12-14 @file MMSForm.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.*;import java.io.*;public class MMSForm extends Form implements CommandListener{ private Command exitCommand; private Command sendCommand; private TextField toNr; private TextField toMail; private byte []data; /* * Parameter InputStream is the file to be appended to the MMS. */ public MMSForm(InputStream is){ super("MMS Recipient"); try{ data = new byte[is.available()]; is.read(data); }catch(Exception e){ e.printStackTrace(); } exitCommand = new Command("Exit", Command.SCREEN, 1); sendCommand = new Command("Send MMS", Command.SCREEN, 0); setCommandListener(this); addCommand(sendCommand); addCommand(exitCommand); toNr = new TextField("Phone Number:", "", 50, TextField.PHONENUMBER); toMail = new TextField("Mail Address:", "", 50, TextField.EMAILADDR); append(toNr); append(toMail); } public void commandAction(Command command, Displayable displayable) { if(command==exitCommand){ MMSSender.midlet.notifyDestroyed(); }else if(command==sendCommand){ MMS mms = new MMS(data); String to = toNr.getString(); if(to.compareTo("") != 0) mms.addRecipient(to); to = toMail.getString(); if(to.compareTo("") != 0) mms.addRecipient(to); mms.send(); } } }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -