这 个程序哪儿有错啊,我就是找不到啊,望不吝指教!!!!!!!!
import java.awt.*;
import java.awt.event.*;
public class dictionary extends Frame implements ActionListener,ItemListener,TextListener
{
static dictionary frm=new dictionary();
static Label lab1=new Label("中文释义为:");
static Label lab2=new Label();
static TextField tex=new TextField();
static Button btn=new Button("添加");
static Choice cho=new Choice();
String Eng[];String Chi[];
Eng=new String[15];
Chi=new String[15];
public static void main(String args[])
{
frm.setLayout(null);
frm.setTitle("应用与维护");
frm.setBounds(100,100,700,700);
lab1.setBounds(100,100,300,100);
lab2.setBounds(100,250,400,100);
tex.setBounds(100,400,600,100);
btn.setBounds(100,550,100,100);
cho.setBounds(250,550,350,100);
cho.add("英文单词");
tex.addTextListener(frm);
btn.addActionListener(frm);
cho.addItemListener(frm);
frm.add(lab1);
frm.add(lab2);
frm.add(tex);
frm.add(btn);
frm.add(cho);
frm.setVisible(true);
}
public void textValueChanged(TextEvent e)
{
for(int a=1;a<=15;a++)
System.out.println(a+"次处理");
}
public void actionPerformed(ActionEvent e)
{
String str;
str=tex.getText();
int i=1;
char c=str.charAt(i);
while(c!='#')
{
i++;
c=str.charAt(i);
}
int j=0;
while(j<15)
{
Eng[j]=new String();
Chi[j]=new String();
Eng[j]=str.substring(0,i);
Chi[j]=str.substring(i);
if(cho.getItemCount()<=15)
cho.add(Eng[j]);
j++;
}
tex.setText(" ");
}
public void itemStateChanged(ItemEvent e)
{
int dex;
dex=cho.getSelectedIndex();
if(dex>=1)
lab2.setText(Chi[dex-1]);
}
}