import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class testitem{
      public static void main(String args[]){
            windows win=new windows();
            win.setBounds(100,100,400,300);
            win.setTitle("简单计算器");
      }   
}class windows extends JFrame{
    JTextField one=new JTextField(5);
    JTextField two=new JTextField(5);
    JComboBox<String>fuhao;
    JTextArea show=new JTextArea(9,30);
    JButton button=new JButton("计算");
    Item a=new Item();
    action b=new action();
    windows(){
    init();
    setVisible(true);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    void init(){
         setLayout(new FlowLayout());
         fuhao=new JComboBox<String>();
         String [ ] tim={"+","-","*","/"};
         for(int i=0;i<tim.length;i++){
             fuhao.addItem(tim[i]);
         }
         a.setJComeBox(fuhao);
         a.setWorkTogether(b);
         b.setone(one);
         b.settwo(two);
         b.setarea(show);
         fuhao.addItemListener(a);
         button.addActionListener(b); 
         add(one);
         add(fuhao);
         add(two);
         add(button);
         add(new JScrollPane(show));   
    }
}class Item implements ItemListener{
    JComboBox choise;
    action together;
    void setJComeBox(JComboBox choise){
    this.choise=choise;
    }
    void setWorkTogether(action together){
    this.together=together;
    }
    public void itemStateChanged(ItemEvent e){
    String fuhao=choise.getSelectedItem().toString();
    together.setfuhao(fuhao);
    }
}class action implements ActionListener{
    JTextField one,two;
    JTextArea show;
    String fuhao;
    void setone(JTextField one){
         this.one=one;
    }
    void settwo(JTextField two){
         this.two=two;
    }
    void setarea(JTextArea show){
         this.show=show;
    }
    void setfuhao(String fuhao){
         this.fuhao=fuhao;
    }
    public void actionPerformed(ActionEvent e){
          try{
             double num1=Double.parseDouble(one.getText() );
             double num2=Double.parseDouble(two.getText() );
             double result=0;
             if(fuhao.equals("+")){
                result=num1+num2;
             }
             else if(fuhao.equals("-")){
                result=num1-num2;
             }
             else if(fuhao.equals("*")){
                result=num1*num2;
             }
             else if(fuhao.equals("/")){
                result=num1/num2;
             }
             show.append(num1+fuhao+num2+"="+result+"\n");
          }
          catch(Exception exp){
                   show.append("just math!\n");
          }
    }
}为什么加法运算报错,求大神帮忙!