0
                if (bsave == e.getSource()) {
        path=null;
        try {
            getpath();
        } catch(Exception ee) {
            JOptionPane ss=new JOptionPane();
            ss.showMessageDialog(this,"Something wrong with the path....maybe Chinese name....");
        }
        if (path==null) return ;
        setTitle(path);
        try {
            File file=new File(path);   
            if(!file.exists()) file.createNewFile(); 
            FileWriter fw = new FileWriter(path,true);
            BufferedWriter bw = new BufferedWriter(fw);
            String myreadline=textf.getText();
            if (ty==0) {
                if (fw==null) System.out.println(fw);
                System.out.println(ty);
                bw.write(myreadline);
            } if (ty==1) {
                int len=myreadline.length();
                for (int i=0;i<len;i+=8) {
                    bw.write((char) chan.parseInt(myreadline.substring(i,i+7),2));
                }
            } else {
                int len=myreadline.length();
                for (int i=0;i<len;i+=2)
                    bw.write((char) chan.parseInt(myreadline.substring(i,i+1),16));
            }
            br.close();  
            fr.close();
        } catch(Exception e0) {
            System.out.println(e0.toString());
        }           
    }   

まとめるとこんな感じ…でも出力が「0」なので、あるのかな?

java.lang.NumberFormatException: 入力文字列の場合: "T" "

文字列myreadlineは「T」で始まるので、それを数字に変更しようとしています...書きながら?めちゃくちゃ迷いました..

4

1 に答える 1