📄 searchform.java
字号:
package com.yxw.view;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.*;
import com.yxw.control.*;
public class SearchForm extends Form implements CommandListener {
private Command submit;
private Command cancel;
private TextField keyword;
public SearchForm(String arg0) {
super(arg0);
this.submit=new Command("确定",Command.ITEM,1);
this.cancel=new Command("返回",Command.CANCEL,2);
this.keyword=new TextField("输入歌曲名:","",20,TextField.ANY);
this.addCommand(this.submit);
this.addCommand(this.cancel);
this.append(this.keyword);
this.setCommandListener(this);
//this.append(this.keyword);
// TODO 自动生成构造函数存根
}
public SearchForm(String arg0, Item[] arg1) {
super(arg0, arg1);
// TODO 自动生成构造函数存根
}
public void commandAction(Command arg0, Displayable arg1) {
// TODO 自动生成方法存根
if(arg0==this.submit){
StringBuffer sb=new StringBuffer();
//sb.append("http://localhost/r.mp3");
sb.append("http://localhost/YYServer/queryMusic?key=");
sb.append(this.keyword.getString());
System.out.println(sb.toString());
MainMidlet.forward(new WaitFlash("正在下载结果列表....",sb.toString()));
}else if(arg0==this.cancel){
MainMidlet.goBack();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -