主题:[转帖]大家帮忙看一下!!!!!!!!!
*/
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class PersonMangerSystem extends Applet
implements TextListener, ActionListener,ItemListener
{
Choice ch1;
Choice ch2;
TextField ft1;
TextField ft2;
public void Init()
{ ft1=new TextField("姓名");
ft2=new TextField("工作证号");
ch1=new Choice();
ch2=new Choice();
ch1.add("男");
ch1.add("女");
ch2.add("硕士/博士");
ch2.add("专科/本科");
ch2.add("大专以下");
add(ft1);
add(ft2);
add(ch1);
add(ch2);
ft1.addActionListener(this);
ft2.addActionListener(this);
ch1.addItemListener(this);
ch2.addItemListener(this);
}
public void textValueChanged(java.awt.event.TextEvent){}
public void itemstateChanged(ItemEvent e)
{
Choice temp;
String s;
if(e.getItemSelectable()instanceof Choice)
{
temp=(Choice)(e.getItemSelectable());
s=temp.getSelectedItem();
}
}
}
这个程序错在哪里?怎么没有结果?[em2]
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class PersonMangerSystem extends Applet
implements TextListener, ActionListener,ItemListener
{
Choice ch1;
Choice ch2;
TextField ft1;
TextField ft2;
public void Init()
{ ft1=new TextField("姓名");
ft2=new TextField("工作证号");
ch1=new Choice();
ch2=new Choice();
ch1.add("男");
ch1.add("女");
ch2.add("硕士/博士");
ch2.add("专科/本科");
ch2.add("大专以下");
add(ft1);
add(ft2);
add(ch1);
add(ch2);
ft1.addActionListener(this);
ft2.addActionListener(this);
ch1.addItemListener(this);
ch2.addItemListener(this);
}
public void textValueChanged(java.awt.event.TextEvent){}
public void itemstateChanged(ItemEvent e)
{
Choice temp;
String s;
if(e.getItemSelectable()instanceof Choice)
{
temp=(Choice)(e.getItemSelectable());
s=temp.getSelectedItem();
}
}
}
这个程序错在哪里?怎么没有结果?[em2]