我如何在drjava中导入我的jar文件?

时间:2012-11-25 07:32:21

标签: macos

我已经将文件添加到额外的类路径但是当我尝试调用方法“boolean ImageLibary.loadImage(File f)”时,我得到错误找不到符号..

公共类ImageEditing {     public static void main(String [] args)抛出异常

{
  File image =  getfile();
  boolean i= ImageLibary.loadImage(image); // error occurs here



}
public static File getfile()
{
    JFileChooser chooser = new JFileChooser();
    try 
    {
        String currentDir = System.getProperty("user.dir");
        chooser.setCurrentDirectory(new File(currentDir));
    }
    catch (Exception e)
    {
        System.out.println("Warning: Error setting current folder: "+e.getMessage());
    }
    File file = null;
    int returnValue;

    returnValue = chooser.showOpenDialog(null);

    if(returnValue==JFileChooser.APPROVE_OPTION)
    {
        file = chooser.getSelectedFile();
    }
    return file;
}

}

0 个答案:

没有答案