public void actionPerformed(ActionEvent arg0) {
        // TODO Auto-generated method stub
        try{
        m=Integer.parseInt(jt1.getText());
        n=Integer.parseInt(jt2.getText());
        }catch(Exception e){
            iex=false;
        }
        //repaint();
        writeFile();
        setTextToJTextArea();
        
    }private void writeFile() {
        // TODO Auto-generated method stub
        boolean f;
        int i,j;
        
        try{
            File file=new File("123.txt");
            if(file.exists()){ja.append("文件存在!"/*+lineSeparator*/);}
            else{
                ja.append("文件不存在!"/*+lineSeparator*/);
                file.createNewFile();
                ja.append("文件创建成功!"/*+lineSeparator*/);
            }            BufferedWriter output = null;
            if(iex){
            for(i=m;i<=n;i++){
                f=true;
                for(j=2;j<i-1;j++){
                    if(i%j==0){f=false;break;}
                }
                if(f){
                     output = new BufferedWriter(new FileWriter(file));
                    output.write(""+i+",");
                     output.newLine();
                     }
                     
            }
            output.close();
            }
            else{
                ja.append("输入有误!");
            }
            
        }catch(Exception e){e.printStackTrace();}
        
    }
m,n的值在第一个函数中获得,但在第二个函数中,怎么知道m、n的值为多少呢??两个函数不是并列的吗?为什么第二个函数中m、n的值就是第一个函数中m、n的值呢?在下初学,见笑了,请指教 ,非常感谢……