Discussion Board

Results 1 to 2 of 2
  1. #1
    1. File f = new File("C:/pics1");
    2. File[ ] files = f.listFiles();

    3. for (File f1 : files) {
    4. try {
    5. BufferedImage bufferedImage8 = ImageIO.read(f1);
    6. if (bufferedImage8.getHeight(null) != Constants.IMAGE_HEIGHT
    || bufferedImage8.getWidth(null) != Constants.IMAGE_WIDTH) {
    bufferedImage8 = GraphicsUtilities.resizeImage(bufferedImage8,
    Constants.IMAGE_WIDTH, Constants.IMAGE_HEIGHT);
    }
    // index.setFilePath(f.getAbsolutePath());
    //indexWriter.addIndex(index);
    Index index = indexWriter.getIndex(bufferedImage8);
    indexes.add(index);
    // numIndex++;
    } catch (IOException ex) {
    ex.printStackTrace();



    In the above at the 6th line am getting "Exception in thread "main" java.lang.NullPointerException" error...
    please tell me what is wrong with this....

  2. #2
    Nokia Developer Champion hartti's Avatar
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192
    hard to say without seeing the implementation of BufferedImage or not knowing if Constants.IMAGE... constants are properly defined. etc.

    Hartti

Similar Threads

  1. [moved] what is the wrong in this code snippet?
    By cenbek03 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-11-18, 12:31
  2. What is wrong with this code? (resource file)
    By Audun Holme in forum Symbian C++
    Replies: 2
    Last Post: 2007-05-10, 06:02
  3. what is wrong with the code?
    By naneziris in forum Mobile Java General
    Replies: 1
    Last Post: 2006-06-01, 04:41
  4. Dynamic memory allocation : what is wrong with this code?
    By symbian_ravi in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2005-10-07, 03:58
  5. whats wrong with the following code
    By mankugupta in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-10-31, 06:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved