John
John

Reputation: 3

BufferedImage not found

I'm working on image processing with java but the BufferedImage is not resolved and the compiler yells "BufferedImage cannot be resolved to a type".

How to fix that?

Here is my code:

import javax.imageio.*;
 
 public class Main {
   public static void main(String[] args){
     BufferedImage img = null;
  }
 }

I tried to resolve that issue but nothing changed

Upvotes: 0

Views: 1128

Answers (1)

Tarmo
Tarmo

Reputation: 4081

That's because you are importing javax.imagio.*, but you should be importing java.awt.image.*.

https://docs.oracle.com/javase/7/docs/api/java/awt/image/BufferedImage.html

Upvotes: 1

Related Questions