Netbeans 如何将拍摄的图像保存在gallery文件夹或手机存储器中?

Netbeans 如何将拍摄的图像保存在gallery文件夹或手机存储器中?,netbeans,java-me,Netbeans,Java Me,我正在使用诺基亚3120,希望将拍摄的图像保存在手机存储器中,但当我保存图像时,会出现异常安全性Java/lang/SecurityException访问被拒绝 我的代码 FileConnection fileConn = null; DataOutputStream dos = null; try { fileConn = (FileConnection) Connector.open( "fil

我正在使用诺基亚3120,希望将拍摄的图像保存在手机存储器中,但当我保存图像时,会出现异常安全性
Java/lang/SecurityException
访问被拒绝

我的代码

FileConnection fileConn = null;
        DataOutputStream dos = null;

        try {
            fileConn = (FileConnection) Connector.open(
                    "file:///C:/story123.jpg");    /*//"file:///root1/story123.jpeg");*/
            if (!fileConn.exists()) {
                fileConn.create();
            }
            dos = new DataOutputStream(fileConn.openOutputStream());
            dos.write(photo);
            dos.flush();
            dos.close();
            fileConn.close();

        } catch (IOException ioe) {
            System.out.println("Error!" + ioe);
        }

J2ME非常严格。可能手机不允许在文件系统的根文件夹中存储内容。 尝试查找“图像”文件夹,并将其存储在那里

您可以使用

System.getProperty(“fileconn.dir.photos”)

另见

该手机不支持Java/J2ME,请阅读此处的说明。