1

我已经将文件添加到额外的类路径中,但是当我尝试调用方法“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;
}

}

4

0 回答 0