如何使用MIDlet创建文件

时间:2018-10-25 11:11:17

标签: java java-me

    protected void startApp() throws MIDletStateChangeException {
       // TODO Auto-generated method stub
       FileConnection fconn = null;
    try {
        fconn = (FileConnection)Connector.open("file:///D:/aaa.txt",Connector.READ_WRITE);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    if(fconn.exists()){
        System.out.println("file is created");
    }

0 个答案:

没有答案