亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? movieslist.java

?? Mobile Services
?? JAVA
字號:
import javax.microedition.midlet.MIDlet;
 
import javax.microedition.lcdui.List;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
import javax.microedition.lcdui.ChoiceGroup;
 
import java.util.Vector;
import java.util.Enumeration;
/* This MIDlet is called when the user selects Movies from the MainClass List */
public class  MoviesList extends MIDlet implements CommandListener
{
	static int counter = 0;
  	/* Declaration of different objects */
  	String hallname,realhall,showdate,bookname,bookemail,booktime,bookcategory
  			,strshow,strbal,strrear,strupper,strmiddle;
 	DataParser parsemoviedata;
  	Vector name,id,details;
  	int commandvalue = 0;
  	private Display displaymovielist;
  	private List halllist,listmovies,listdate;
  	private Form statusform,yourname,emailform,categoryform,/*timeform,*/ticketform;
  	private StringItem sitem;
  	private Command backtodate,backtomovie,backtohall,bookticket,backtostatus,
  			emailscreen,backtoname,categoryscreen,backtoemail,backtocat,ticketscreen,
  			finalbook,exitcommand;
  	private TextField entername,enteremail,enterticket;
  	private ChoiceGroup categorybuttons;
  	private MainClass lastscreen;
  	/* Constructor of the Movielist class declared */
 	MoviesList(Display disp,MainClass obj)	
  	{
 		lastscreen = obj;
 		displaymovielist = disp;
  		exitcommand = new Command("Exit",Command.EXIT,1);
  		halllist = new List("Select Hall",List.IMPLICIT);
  		halllist.setCommandListener(this);
  		halllist.addCommand(exitcommand);
  
 	}
  	/* This is start of an application. This method is called when the application is called */
  	public void startApp()
  	{
 		parsemoviedata = new DataParser();
 		/* This will make an Http connection and open an InputStream to read from the connection */
 		parsemoviedata.sourceurl("http://192.192.168.100/midlet/template/midlet_movies.xml");
 		/* This will parse the XML data */
  		parsemoviedata.parseDataMovies(1);
  		/* values taken in a vector */
  		name = parsemoviedata.hall_name();
 		id = parsemoviedata.hall_id();
 		/* This will create a list with the hall name to be displayed to the user */
  		for(Enumeration enum = name.elements() ; enum.hasMoreElements() ;) 
  		{
 			 halllist.append((String)enum.nextElement(),null);
  		}
   		/* List displayed */
 		displaymovielist.setCurrent(halllist);
  		/* Command objects declared */
  		backtodate = new Command("Back",Command.BACK,1);
  		backtomovie = new Command("Back",Command.BACK,1);
  		backtohall = new Command("Back",Command.BACK,1);
  		bookticket = new Command("Book",Command.SCREEN,1);
  		backtostatus = new Command("Back",Command.BACK,1);
  		emailscreen = new Command("OK",Command.SCREEN,1);
  		backtoname = new Command("Back",Command.SCREEN,1);
  		categoryscreen = new Command("OK",Command.SCREEN,1);
  		backtoemail = new Command("Back",Command.SCREEN,1);
  		backtocat = new Command("Back",Command.SCREEN,1);
  		ticketscreen = new Command("OK",Command.SCREEN,1);
  		finalbook = new Command("BOOK",Command.SCREEN,1);
  		
  	}	
  	/* destroyApp() method declared. This will free the resources */
  	public void destroyApp(boolean b)
  	{
  		backtodate = null;
  		backtomovie = null;
  		backtohall = null;
  		bookticket = null;
  		backtostatus = null;
  		emailscreen = null;
  		backtoname = null;
  		categoryscreen = null;
 		backtoemail = null;
  		backtocat = null;
  		ticketscreen = null;
  		finalbook = null;
  		exitcommand = null;
  	}
 
  	public void pauseApp()
  	{}
 	/* This method is used for event handling */
  	public void commandAction(Command c, Displayable d)
  	{
  		
		/* this is true if an item is selected in the list */
  		if(c == List.SELECT_COMMAND)
  		{
  			if(halllist.isShown())
  			{
  				realhall = halllist.getString(halllist.getSelectedIndex());
  				hallname = halllist.getString(halllist.getSelectedIndex());
  			}
  			else if(listmovies.isShown())
  				hallname = listmovies.getString(listmovies.getSelectedIndex());
  			else if(listdate.isShown())
 				hallname = listdate.getString(listdate.getSelectedIndex());
  			counter++;
  			getAllData(hallname,counter);
  		}		
  		/* This will display the date list. On click of Back button */
  		if(c == backtodate)
  		{
  			displaymovielist.setCurrent(listdate);
  			counter = 2;
  		}
  		/* This will display the movie list. On click of Back button */
  		if(c == backtomovie)
  		{
  			displaymovielist.setCurrent(listmovies);
  			counter = 1;
  		}
  		/* This will display the hall list. On click of Back button */
  		if(c==backtohall)
  		{
  			displaymovielist.setCurrent(halllist);
  			counter = 0;
  		}
  		/* This will display a form asking the user to enter his name. On click of Book button */
  		if(c==bookticket)
  		{
  			yourname = new Form("Enter your Name");
  			yourname.setCommandListener(this);
  			yourname.addCommand(emailscreen);
  			yourname.addCommand(backtostatus);
  			entername = new TextField("Enter Name","",20,TextField.ANY);
  			yourname.append(entername);
  			displaymovielist.setCurrent(yourname);
  		}
  		/* This will display the status form. On click of Back button */
  		if(c == backtostatus)
  		{
  			displaymovielist.setCurrent(statusform);
  		}
  		/* This will display the form asking the user to enter his name. On click of Back button */
  		if(c == backtoname)
  		{
  			displaymovielist.setCurrent(yourname);
  		}
  		/* This will display the form asking the user to enter his email. On click of Back button */
  		if(c == backtoemail)
  		{
  			displaymovielist.setCurrent(emailform);
  		}
  		/* This will display the form for selecting a category like "balcony" and "rear stall" etc
  		. On click of Back button */
  		if(c == backtocat)
 		{
  			displaymovielist.setCurrent(categoryform);
 		}
  		/* This will ask the user to enter his email address.On click of OK button */
  		if(c == emailscreen)
  		{
  			bookname = entername.getString();
  			emailform = new Form("Enter your Email");
  			emailform.setCommandListener(this);
  			enteremail = new TextField("Enter Email","",30,TextField.EMAILADDR);
  			emailform.append(enteremail);
 			emailform.addCommand(backtoname);
  			emailform.addCommand(categoryscreen);
  			displaymovielist.setCurrent(emailform);
  		}
  		/* This will ask the user to select a category.On click of Ok button */
  		if(c == categoryscreen)
  		{
  			bookemail = enteremail.getString();
  			categoryform = new Form("Select a Category");
  			categoryform.setCommandListener(this);
  			categorybuttons = new ChoiceGroup("Category",ChoiceGroup.EXCLUSIVE);
  			categorybuttons.append("Balcony",null);
  			categorybuttons.append("Rear Stall",null);
  			categorybuttons.append("Upper Stall",null);
  			categorybuttons.append("Middle Stall",null);
  			categoryform.append(categorybuttons);
  			categoryform.addCommand(backtoemail);
  			categoryform.addCommand(ticketscreen);
  			displaymovielist.setCurrent(categoryform);
  		}
  		/* This will ask the user to enter the number of tickets to be booked.On click of OK button */ 
  		if(c == ticketscreen)
  		{
  			bookcategory = categorybuttons.getString(categorybuttons.getSelectedIndex());
  			ticketform = new Form("Enter the Tickets");
 			ticketform.setCommandListener(this);
  			enterticket = new TextField("Enter Ticket","",6,TextField.NUMERIC);
  			ticketform.append(enterticket);
  			ticketform.addCommand(backtocat);
  			ticketform.addCommand(finalbook);
  			displaymovielist.setCurrent(ticketform);
  		}
  		/* This will book the tickets for the user. On click of a Book Button */
  		if(c == finalbook)
  		{
  			String url = "fname="+bookname +"&email="+ bookemail +"&hallid="+Integer.parseInt((String)id.elementAt(name.indexOf(realhall)))+ "&" +bookcategory+"="+ Integer.parseInt(enterticket.getString())+ "&showtime=" + booktime +"&showdate="+showdate;
  			System.out.println("Print this url " + url);
			url = url.trim();
			/*try
    			{
  				/* This will create an HTPP connection object */
  				//HttpConnection con = (HttpConnection)Connector.open(url);
  				/* This will open an InputStream to the connection */
  				//InputStream ins = con.openInputStream();
  				//ins.close();
  			/*}
  			catch(IOException ex)
    			{
    				System.out.println("IOException occured");
   			}*/
  			
			int i = 0;
			int j=0;
			StringBuffer strbuf = new StringBuffer();
			while(i < url.length())
			{
				i = url.indexOf(" ",i+1);
				if(i == -1)
					break;
				strbuf = strbuf.append(url.substring(j,i));
				strbuf = strbuf.append("%20");
				j = i+1;
			}
			strbuf = strbuf.append(url.substring(j,url.length()));
			System.out.println("This is the value of " + strbuf);
			destroyApp(true);
  			notifyDestroyed();
  			lastscreen.getDisplayObject(displaymovielist);
  		}
  		/* This will delete the MIDlet and close the application */
  		if(c == exitcommand)
  		{
  			destroyApp(true);
  			notifyDestroyed();
  			lastscreen.getDisplayObject(displaymovielist);
  		}
  	}		
  	/* This method is very important method. This method is used to manupulate more than one List */
  	private void getAllData(String str,int counter)
  	{
  		/* this if condition is true if an item is selected from the hall list */
 		if(counter == 1)
 		{	
  			listmovies = new List("List of Movies",List.IMPLICIT);
 			listmovies.setCommandListener(this);
		listmovies.addCommand(backtohall);
 			parsemoviedata.sourceurl("http://192.192.168.100/midlet/template/midlet_status.xml?tname=" + str);
 			parsemoviedata.parseDataMovies(2);
  			details = parsemoviedata.halldata();
  			details.trimToSize();
  			for (Enumeration enum = details.elements();enum.hasMoreElements();) 
  			{
  				if(enum.nextElement().equals("ms"))
  				{
  					listmovies.append((String)enum.nextElement(),null);
  				}
 			}
 			displaymovielist.setCurrent(listmovies);
  		}
  		/* this if condition is true if an item is selected from the movies list */
  		if(counter == 2)
  		{
  			listdate = new List("Show Date",List.IMPLICIT);
  			listdate.setCommandListener(this);
  			listdate.addCommand(backtomovie);
  			int indexofmovie = details.indexOf(str);
  			int indexofms = details.indexOf("ms",indexofmovie+2);
  			if(indexofms == -1)
  				indexofms = details.size();
  			while(indexofmovie < indexofms)
  			{
  				if((details.elementAt(indexofmovie)).equals("st"))
  				{
  					listdate.append((String)details.elementAt(indexofmovie+1),null);
 				}
  				indexofmovie++;
  			}
  			displaymovielist.setCurrent(listdate);
  			
  		}
  		/* this if condition is true if user selects date from the date list */
  		if(counter == 3)
  		{
  			showdate = str;
  			statusform = new Form("Status of Movie");
  			statusform.setCommandListener(this);
  			statusform.addCommand(backtodate);
  			statusform.addCommand(bookticket);
  			int indexdate = details.lastIndexOf(str);
  			int indexms = details.indexOf("ms",indexdate);
  			int indexst = details.indexOf("st",indexdate);
  			indexdate+=1;
  			if(indexst == -1)
  				indexst = details.size();
  			if(indexms == -1)
  				indexms = details.size();
  			String sarray[] = {"Show Time","Balcony","Rear Stall","Upper Stall","Middle Stall"};
  			int i = 0;
  			while((indexdate) < indexms)
  			{
  				if(i > 4)
  					break;
  				if(i==0)
  				{	
  					booktime = 	(String)details.elementAt(indexdate);
  				}					
  				sitem = new StringItem(sarray[i],(String)details.elementAt(indexdate));
  				statusform.append(sitem);
  				indexdate++;
  				i++;
  			}
  			displaymovielist.setCurrent(statusform);
  		}
  	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩高清在线播放| 国产成人精品一区二区三区四区 | 亚洲444eee在线观看| 91天堂素人约啪| 亚洲精品国产无天堂网2021| 色久综合一二码| 亚洲永久免费视频| 欧美高清视频一二三区| 六月丁香婷婷久久| 久久久国际精品| 成人av电影在线| 一级中文字幕一区二区| 欧美日韩激情一区二区三区| 三级在线观看一区二区| 777奇米四色成人影色区| 久久er99精品| 中文在线免费一区三区高中清不卡| 成人免费毛片嘿嘿连载视频| 尤物av一区二区| 日韩欧美色电影| 成人性生交大片免费看在线播放| 亚洲乱码中文字幕| 51午夜精品国产| 成人一区二区视频| 亚洲成人在线免费| 久久久精品tv| 欧美另类高清zo欧美| 国产精品自拍av| 一区二区不卡在线播放 | 日韩国产欧美三级| 久久久精品人体av艺术| 欧美日韩一区在线| 国产自产视频一区二区三区| 亚洲欧美日韩一区二区三区在线观看| 欧美日韩国产天堂| 成人免费看视频| 日本免费新一区视频| ...xxx性欧美| 精品国产精品网麻豆系列| 日本韩国精品在线| 国产精品一卡二卡在线观看| 亚洲高清视频在线| 国产精品久久久久一区| 欧美成人综合网站| 欧美天堂一区二区三区| 成人av在线资源网| 黄色成人免费在线| 午夜影院久久久| 最新成人av在线| 精品捆绑美女sm三区| 欧美色网一区二区| 91一区二区三区在线播放| 国产在线播放一区| 奇米影视在线99精品| 亚洲综合色噜噜狠狠| 国产精品毛片高清在线完整版| 日韩一区二区三区在线| 欧美综合久久久| 97精品久久久久中文字幕| 国产 欧美在线| 国产美女av一区二区三区| 亚洲电影第三页| 亚洲激情在线激情| 亚洲免费在线观看| 国产精品成人一区二区三区夜夜夜| 久久夜色精品国产欧美乱极品| 欧美高清视频在线高清观看mv色露露十八| 色欧美乱欧美15图片| 99久久99久久精品免费观看 | 日本欧美大码aⅴ在线播放| 亚洲精品ww久久久久久p站 | 亚洲综合成人网| 亚洲免费在线观看| 亚洲黄色小说网站| 亚洲伦理在线免费看| 一区二区欧美视频| 亚洲一区中文日韩| 一区二区成人在线视频| 亚洲国产精品天堂| 五月婷婷综合网| 日韩不卡免费视频| 免费高清成人在线| 狠狠色丁香婷婷综合久久片| 久久er精品视频| 国产aⅴ综合色| 成人av动漫网站| 欧美综合色免费| 91精品国产综合久久精品麻豆 | 欧美中文字幕不卡| 欧美日韩一级黄| 日韩一区二区在线观看视频| 日韩视频免费观看高清在线视频| 日韩欧美色电影| 国产女主播在线一区二区| 国产精品久久久久婷婷二区次| 中文字幕亚洲成人| 亚洲成人资源在线| 经典三级视频一区| av成人免费在线观看| 在线免费观看日本一区| 欧美高清视频在线高清观看mv色露露十八 | 欧美不卡视频一区| 国产日韩精品视频一区| 亚洲视频每日更新| 日韩精彩视频在线观看| 国产一区二区三区四区五区美女| 国产精品一区二区在线播放| 不卡的av网站| 欧美视频完全免费看| 日韩三级视频在线看| 中文字幕的久久| 亚洲国产精品一区二区久久| 国产在线乱码一区二区三区| 成人av先锋影音| 56国语精品自产拍在线观看| 国产日韩欧美一区二区三区综合| 亚洲精品成人在线| 九色综合狠狠综合久久| 91免费视频观看| 日韩欧美在线不卡| 亚洲日本电影在线| 久久精品国产亚洲高清剧情介绍 | 国产精品小仙女| 色噜噜夜夜夜综合网| 日韩免费视频一区| 亚洲男人电影天堂| 韩日av一区二区| 欧亚一区二区三区| 国产精品乱码久久久久久| 天堂成人国产精品一区| 成人av片在线观看| 91精品国产91久久久久久最新毛片| 久久久亚洲精品一区二区三区 | 免费成人结看片| 99精品视频在线观看免费| 日韩一区国产二区欧美三区| 一区二区在线免费观看| 国产精品一二三四| 日韩欧美综合在线| 亚洲在线一区二区三区| 成人avav影音| 久久―日本道色综合久久| 午夜激情久久久| 91麻豆免费看| 国产精品麻豆久久久| 国产一区二区电影| 欧美成人video| 五月天激情综合| 欧美自拍偷拍一区| 国产精品久久久久9999吃药| 国产一区在线不卡| 亚洲高清视频的网址| 91影院在线观看| 亚洲天堂免费看| 成人av免费在线播放| 欧美激情一区二区三区| 国产一区 二区| 2020国产精品自拍| 精品在线视频一区| 日韩午夜小视频| 奇米色一区二区| 欧美一区二区精品在线| 五月婷婷激情综合网| 欧美午夜一区二区三区| 亚洲综合免费观看高清完整版在线| 99精品久久久久久| 亚洲欧美在线观看| 色综合视频在线观看| 亚洲人xxxx| 色婷婷久久一区二区三区麻豆| 综合色中文字幕| 色屁屁一区二区| 一区二区三区免费在线观看| 色婷婷激情综合| 亚洲五码中文字幕| 欧美老女人第四色| 免费成人小视频| 国产午夜精品理论片a级大结局| 国产福利电影一区二区三区| 国产婷婷色一区二区三区四区| 国产成人自拍在线| 中文字幕在线一区免费| 色婷婷综合五月| 日韩精品乱码免费| 午夜欧美2019年伦理| 欧美一区二区三区四区久久| 老司机一区二区| 国产精品网站在线播放| 99国产精品一区| 天天操天天综合网| 欧美mv和日韩mv的网站| 国产精品1区2区| 亚洲精品免费在线观看| 欧美精品丝袜久久久中文字幕| 日韩国产精品久久久| 亚洲精品在线电影| 成人爱爱电影网址| 午夜精品久久久久久久 | 国产喷白浆一区二区三区| 成人激情免费网站|