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

📄 optionsinputform.java

📁 相册是J2me MIDLet 的一个demo程序
💻 JAVA
字号:
/*
 *  Filename: OptionsInputForm.java 
 *  - contains definition of the class OptionsInputForm. It is a Form with choice group to allow user to indicate
 *  whether looping is required during showing images in Album and with text field for user to enter the time 
 *  interval to be used in slide show. 
 * 
 *
 *  Application Name: Image Album Demo 
 *  Version: 2.0
 *  Release Date: 27th September, 2002
 *  Author:	Edmund Wong, Application Engineer, Metrowerks Hong Kong
 *
 *
 *  (c) Copyright. 2002. Metrowerks Corp. ALL RIGHTS RESERVED.
 *	This code is provided "AS IS" without warranty of any kind and subject to Metrowerks Sample Application
 *  End User License Agreement. NO EXTERNAL DISTRIBUTION OR COMMERCIALIZATION OF THE SOFTWARE IS PERMITTED 
 *  EXCEPT BY WRITTEN AGREEMENT OF METROWERKS."
 */

import javax.microedition.lcdui.*;
	

public class OptionsInputForm extends Form implements CommandListener{

    /**
     * Create Items for OptionsInputForm
     */
		 		
	// choice group for user to indicate whether looping is opted
	
	ChoiceGroup loopChoice = new ChoiceGroup("Looping?",Choice.MULTIPLE);	
																			
	// Text field for user to enter the time for showing each image 
	
	TextField slideDisplayTimeEntry = new TextField("For slide show:", "3", 1, TextField.NUMERIC);
		
	// Create Enter Command for returning back to main menu after entering options in the form
		
	public Command enterCommand = new Command("Enter",Command.OK,0); 
	
		
	ImageAlbum imageAlbumReference;	// reference for main object ImageAlbum
	
	
	/**
     * Constructor for OptionsInputForm
     */
		
	public OptionsInputForm(ImageAlbum imageAlbumReference) {
	
		super("Select preference!");
	
		this.imageAlbumReference = imageAlbumReference;
	
	
	   /**
     	* Add items for the Options Input Form
     	*/
			
		loopChoice.append("YES",null);
		
		append(loopChoice);
		
		append(slideDisplayTimeEntry);
		
		append(new StringItem("","seconds for each slide (max. 9 seconds)")); 
		
	
	   /**
     	* Add command for the Options Input Form
     	*/
     	
		addCommand(enterCommand);
		
		addCommand(ImageAlbum.mainMenuCommand);
		
		setCommandListener(this);
	
	   
	
	}
	
	/**
     * Implementation for CommandListener
     */
     
    public void commandAction(Command c, Displayable s) {

		 
    	//	Return to main menu after entering options in options input form
    	    	 	
		if (c==enterCommand) {
		
			ImageAlbum.myDisplay.setCurrent(imageAlbumReference.selectList);
		
		}	
		
		//	Return to main menu 
		
		if (c==ImageAlbum.mainMenuCommand) {
	
			ImageAlbum.myDisplay.setCurrent(imageAlbumReference.selectList);
	
		}	
	
	}
} 

	

⌨️ 快捷键说明

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