c.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
Object selected = c.getSelectedItem();
s = (String)selected;
tf1.setText(s);
}
});
在设置文本时,它会在通知中提供错误尝试变异。除此之外,如果我写label.setText(s);它没有给出错误并根据组合中的选定项设置文本... c是JComboBox对象