Results 1 to 14 of 14
  1. #1
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default help with some pixels

    here is the line of code, if I use this together with some other code it should do something with the screen on my GUI:
    Java Code:
    private BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
    	private int[] pixels = ((DataBufferInt)image.getRaster().getDataBuffer()).getData();
    it tells me that DataBufferInt cannot be resolved as a type. I am using JRE 7. please help anyone? :)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: help with some pixels

    Did you import the class?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: help with some pixels

    import which class? i have imported BufferedImage.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with some pixels

    Quote Originally Posted by HelloWorld1234 View Post
    import which class? i have imported BufferedImage.
    the one the compiler is complaining about perhaps?

    Quote Originally Posted by HelloWorld1234 View Post
    ....
    it tells me that DataBufferInt cannot be resolved as a type. I am using JRE 7. please help anyone? :)
    I may not be a rocket scientist, but I know enough to listen to my compiler when it complains.

  5. #5
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: help with some pixels

    the compiler says there is an unresolved compilation problem with the main method. and I am using eclipse, and eclipse says that DataBufferInt cannot be resolved as a type.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with some pixels

    Quote Originally Posted by HelloWorld1234 View Post
    the compiler says there is an unresolved compilation problem with the main method. and I am using eclipse, and eclipse says that DataBufferInt cannot be resolved as a type.
    Right, and Darryl has asked, "are you missing an import"? Well, are you? The error message is telling you *which* class you may be missing the import on!

  7. #7
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: help with some pixels

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at com.ole.game.Game.main(Game.java:87)

    that is the hole error message^^

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with some pixels

    Quote Originally Posted by HelloWorld1234 View Post
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at com.ole.game.Game.main(Game.java:87)

    that is the hole error message^^
    This tells us that you're trying to run uncompilable code. *Never* do this. Instead tell us the compiler's errors that are shown when you try to *compile* your code, not when you try to run it.

  9. #9
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: help with some pixels

    I dunno how to compile -.- srry, that's why I didn't understand your questions.

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with some pixels

    Are you using any tools to help you create your code, such as an IDE like NetBeans or Eclipse? If so what tool? And does the tool indicate that there's an error present before you try to run your program?

  11. #11
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: help with some pixels

    I use Eclipse, and yes, before I try to run the code the only thing it says is "DataBufferInt cannot be resolved as a type".

  12. #12
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: help with some pixels

    Quote Originally Posted by HelloWorld1234 View Post
    I use Eclipse, and yes, before I try to run the code the only thing it says is "DataBufferInt cannot be resolved as a type".
    OK, and so again, are you importing DataBufferInt?

  13. #13
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: help with some pixels

    thx, I feel stupid... -.-

  14. #14
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Pixels
    By shakeel in forum Java 2D
    Replies: 0
    Last Post: 03-01-2011, 11:32 AM
  2. Decimal Pixels?
    By Jcbconway in forum AWT / Swing
    Replies: 0
    Last Post: 11-29-2010, 09:25 PM
  3. Modified Pixels
    By monkey04 in forum Java 2D
    Replies: 1
    Last Post: 03-12-2009, 08:15 AM
  4. Blurring pixels
    By tim in forum New To Java
    Replies: 0
    Last Post: 01-01-2008, 02:06 PM
  5. Counting Pixels
    By shaungoater in forum Java 2D
    Replies: 5
    Last Post: 11-29-2007, 05:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •