[英]How to set File Path in Netbeans ide
I have created a desktop application in which I am using Jasper report design file (jrxml ). 我创建了一个桌面应用程序,在其中使用Jasper报表设计文件(jrxml )。 I put the jrxml file in the same folder where I have my java code. 我将jrxml文件放在拥有Java代码的同一文件夹中。 As the file path I used 作为我使用的文件路径
FileInputStream fl = new FileInputStream("D:\\Sandeep MIS project21.02.2014\\Workspace for Hording\\HordingDept\\src\\HordingDept\\report2.jrxml");
But instead of this I want a simple 但是除了这个,我想要一个简单的
File file=new File("report2.jrxml");
My src folder is HordingDept . 我的src文件夹是HordingDept 。 But using the simple path Netbeans shows an eror " file not found ". 但是使用简单路径Netbeans会显示错误“ 文件未找到 ”。 What should I do? 我该怎么办? Please help. 请帮忙。
采用
File file=new File(System.getProperty("user.dir")+"\\src\\HordingDept\\report2.jrxml");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.