📄 singerform.java
字号:
/**
* @(#)SingerForm.java 1.11 01/08/23
* Copyright (c) 2004-2005 wuhua of workroom Inc. All Rights Reserved.
* @version 1.0, 10/05/2004
* @author 饶荣庆
* @author 余煜辉
*/
package com.j2me.recreation.singer;
import com.j2me.language.*;
import com.j2me.recreation.*;
import com.j2me.main.*;
import com.j2me.common.*;
import java.io.*;
import javax.microedition.lcdui.*;
/**
*此类是用艺术家的显示层
*/
public class SingerForm extends Form implements CommandListener
{
private Display display;
private RecreationMenu recreation;
private SingerPhoto s_P;
/*数据输入对象*/
public TextField key; //输入查找关键字;
public ImageItem photo; //显示艺术家图片
public StringItem record; //显示艺术家档案
public StringItem special; //显示艺术家专集
public StringItem action; //显示艺术家活动
/*声音线程*/
/*错误*/
private Alert errorAlert = null;
//定义离开软键
private Command backCommand = null;
public Command okCommand = null;
public Command browseCommand = null;
private String[] data = new String[2];
public String url; //网络图片的路径
/*-----------------------------------------------------------------------
*构造方法
*/
public SingerForm()
{
super("");
this.key = new TextField("*输入艺术家:", "", 100, TextField.ANY);
this.record = new StringItem("档案: \n ", "");
this.special = new StringItem("专集: \n ", "");
this.action = new StringItem("活动: \n", "");
this.photo = new ImageItem("相片: \n", null, Item.LAYOUT_CENTER, "");
this.backCommand = new Command("返回", Command.BACK, 2);
this.okCommand = new Command("确定", Command.BACK, 2);
this.browseCommand = new Command("浏览明星相册", Command.BACK, 2);
this.addCommand(backCommand);
this.addCommand(okCommand);
this.append(key);
this.setCommandListener(this);
}
/*显示菜单界面方法*/
public void showForm(Display display, RecreationMenu recreation) //用来显示界面
{
this.display = display;
this.recreation = recreation;
this.display.setCurrent(this);
}
public void commandAction(Command c, Displayable s)
{
if (c == backCommand)
{
this.display.setCurrent(recreation);
}
if (c == okCommand)
{
//参数
String parameter = "key=" + key.getString().trim();
if (key.getString().trim().compareTo("") != 0)
{
SingerWait s_w = new SingerWait(RecreationServerURL.getURL() + "singer/" + "singer.jsp", parameter);
s_w.setMessage("Download");
s_w.showForm(display, this);
s_w.download();
}
}
if (c == browseCommand)
{
if (Language.isEnglish)
{
s_P = new SingerPhoto(photo.getImage(), url);
s_P.setTitle("Singer Photo");
s_P.download.setLabel("Download:");
s_P.photo.setLabel("Photo:\n");
}
else
{
s_P = new SingerPhoto(photo.getImage(), url);
s_P.setTitle("艺术家相册");
s_P.download.setLabel("下载:");
s_P.photo.setLabel("相片:\n");
}
s_P.showForm(display, recreation);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -