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

📄 loginui.java

📁 基于j2me的电话本基于j2me的电话本
💻 JAVA
字号:
package com.hziee.phone_book.ui;

import com.hziee.phone_book.model.*;

import java.io.DataInputStream;
import java.io.IOException;

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.Command;

import com.hziee.phone_book.PhoneBookMIDlet;

public class LoginUI extends Form implements CommandListener {
	  
	  public StringItem stringItem1;
	  private TextBox textbox;
	  private final TextField usernameField;
	     private Command sendReqCmd;
	     private Command exitCmd;
//	  private final PhoneBookMIDlet midlet;

	 	private Display display;
		private Form loginForm;
		private Form successForm;
		private Form logoutForm;	
		private TextField userName;
		private TextField password;
		private StringItem logoutText;
		private ChoiceGroup autoLogin;
		private UserModel model;
		public static final Command ConnCMD = new Command("连接", Command.OK, 1);
		public static final Command logoutCMD = new Command("Logout", Command.OK, 1);     
	     
	  private UIController uicontroller;  
	 
	  public LoginUI(UIController uicontroller) {

		    super("Displayable Title");
	        this.uicontroller = uicontroller;
//			loginForm = new Form("LoginForm");
			userName = new TextField("username", null, 20, TextField.ANY);
			password = new TextField("password", null, 20, TextField.PASSWORD);
			autoLogin = new ChoiceGroup("AutoLogin", Choice.MULTIPLE,
					new String[] { "remember me" }, null);
			append(userName);
			append(password);
			append(autoLogin);
			addCommand(ConnCMD);
			setCommandListener(this);
	        
	           exitCmd = new Command("Exit",Command.EXIT,1);
	           sendReqCmd = new Command("Send",Command.BACK,2);
	           setCommandListener(this);
	        usernameField = new TextField("输入网址", null, 100, TextField.ANY);

	}



	public void commandAction(Command command, Displayable displayable) {
	  /** @todo Add command handling code */
	   
	  if (command.getCommandType() == Command.EXIT) {
//	 stop the MIDlet    
//	       midlet.notifyDestroyed();   
		  uicontroller.handleEvent(UIController.EventID.EVENT_SEARCHUI_BACK_MAINNUI);
	  }else if(command == sendReqCmd){
//	       usernameField.setString("jiayin");
//	       String link;
//	       if(!usernameField.getString().equals("")){
//	          link = usernameField.getString();      
//	       }else{
//	          link = "http://wap.blueidea.com";
//	       }
	    

	  }
	}


	}

⌨️ 快捷键说明

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