📄 httpclient.java
字号:
package org.gui.com;
import javax.microedition.lcdui.*;
import org.httpClient.com.RMStore;
public class HttpClient extends Form implements CommandListener{
private Display display;
private MusicCanvas mymusic;
private MainForm mainForm;
private RMStore cookie;
private HttpClientSetForm httpSet;
private String[] str={"Http基本要求","校园淘宝网"};
private ChoiceGroup opt = new ChoiceGroup("连接:",ChoiceGroup.EXCLUSIVE);
public static final Command okCommand = new Command("OK", Command.OK, 1);
public static final Command backCommand = new Command("Back",Command.BACK,1);
public HttpClient(Display display,MainForm mainForm,MusicCanvas mymusic)
{
super("HttpClient");
cookie = new RMStore("Cookies");
this.display = display;
this.mainForm = mainForm;
this.mymusic = mymusic;
opt.append(str[0], null);
opt.append(str[1], null);
this.append(opt);
this.addCommand(okCommand);
this.addCommand(backCommand);
this.setCommandListener(this);
}
/*
* (non-Javadoc)
*
* @see javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
* javax.microedition.lcdui.Displayable)
*/
public void commandAction(Command arg0, Displayable arg1)
{
// TODO Auto-generated method stub
if (arg0 == okCommand)
{
if(opt.getSelectedIndex() == 0){//Http基本要求
httpSet = new HttpClientSetForm(display,mainForm,mymusic,this);
display.setCurrent(httpSet);
}else{ //淘宝网
String URL = "http://www.xiaoyuantaobao.com:8080/myWml/login.wml";
AnimationCanvas animation=new AnimationCanvas(display,URL,cookie,this);
display.setCurrent(animation);
}
}else{
display.setCurrent(new MainMenuForm(display,mainForm,mymusic));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -