⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 populateaddressbook.java

📁 7个J2ME例子
💻 JAVA
字号:
/* * Copyright (c) 2000-2001 Sun Microsystems, Inc. All Rights Reserved. */package examples.addressbook;import javax.microedition.midlet.*;import javax.microedition.rms.*;/** * Class to create an example address book and populate it * with some records */public class PopulateAddressBook extends MIDlet {	private final String personalNames[] = {		"John", "Zach", "2225556669",		"Mark", "Lynn", "5125551212",		"Joy", "Beth", "2705551234",		"Abby", "Lynn", "4085558566",		"Ted", "Alan", "4125552235",		"Sterling", "Wincle", "9995559111",		"Deborah", "Elaine", "4445552323",		"Suzanne", "Melissa","5125556064",		"Frank", "Kenneth", "7775551212",		"Dwight", "Poe", "1115557234",		"Laura", "Beth", "2055558888",		"Lisa", "Dawn", "2705551267",		"Betty", "June", "5555551556",		"Yvonne", "Poe", "6665558888",		"Lizzy", "Loo", "5025557971",		"John", "Gerald", "3335551256",		"Mark", "VandenBrink", "1115557878",		"Roger", "Riggs", "3335550000",		"Antero", "Taivalsaari", "9995552222"	};	public PopulateAddressBook() {		RecordStore rs;		RecordEnumeration re;					CreateAddressBook.createRecordStore("TheAddressBook",											personalNames);		try {			rs = RecordStore.openRecordStore("TheAddressBook", true);			re = rs.enumerateRecords(null, null, false);			while (re.hasNextElement()) {				byte[] b = re.nextRecord();				System.out.println("<" + SimpleRecord.getFirstName(b) + ">" +								   "<" + SimpleRecord.getLastName(b) + ">" +								   "<" + SimpleRecord.getPhoneNum(b) + ">");			}		} catch (Exception e) {			System.out.println("Houston, we have a problem: " + e);		}	}    /**     * Called by the system to start our MIDlet.     */	protected void startApp() {		destroyApp(false);		notifyDestroyed();	}	/**	 * Called by the system to pause our MIDlet.	 * No actions required by our MIDLet.	 */	protected void pauseApp() {}	/**	 * Called by the system to end our MIDlet.	 * No actions required by our MIDLet.	 */	protected void destroyApp(boolean unconditional) {}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -