What is the compiler complaining about?

Discussion in 'Java' started by ssecorp, Jul 7, 2008.

  1. ssecorp

    ssecorp Guest

    I odnt get the exact complaint here. and why am i filling in "w" in
    the end again?
    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html


    import java.awt.image.PixelGrabber;

    public class Main {

    public static void main(String[] args) {
    int w = 50;
    int h = 50;
    int[] pixels = new int[w * h];
    PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
    images/giffer.gif", 1, 1, w, h, pixels, 0, w);
    }

    }


    init:
    deps-jar:
    Compiling 1 source file to C:\Users\saftarn\Documents\NetBeansProjects
    \JAItest\build\classes
    C:\Users\saftarn\Documents\NetBeansProjects\JAItest\src\jaitest
    \Main.java:11: cannot find symbol
    symbol : constructor
    PixelGrabber(java.lang.String,int,int,int,int,int[],int,int)
    location: class java.awt.image.PixelGrabber
    PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
    images/giffer.gif", 1, 1, w, h, pixels, 0, w);
    1 error
    BUILD FAILED (total time: 0 seconds)
     
    ssecorp, Jul 7, 2008
    #1
    1. Advertising

  2. On 2008-07-07 22:02 +0100, ssecorp allegedly wrote:
    > import java.awt.image.PixelGrabber;
    >
    > public class Main {
    >
    > public static void main(String[] args) {
    > int w = 50;
    > int h = 50;
    > int[] pixels = new int[w * h];
    > PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
    > images/giffer.gif", 1, 1, w, h, pixels, 0, w);
    > }
    >
    > }
    >
    > init:
    > deps-jar:
    > Compiling 1 source file to C:\Users\saftarn\Documents\NetBeansProjects
    > \JAItest\build\classes
    > C:\Users\saftarn\Documents\NetBeansProjects\JAItest\src\jaitest
    > \Main.java:11: cannot find symbol
    > symbol : constructor
    > PixelGrabber(java.lang.String,int,int,int,int,int[],int,int)
    > location: class java.awt.image.PixelGrabber
    > PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
    > images/giffer.gif", 1, 1, w, h, pixels, 0, w);
    > 1 error
    > BUILD FAILED (total time: 0 seconds)


    > I don't get the exact complaint here.


    It's complaining that a java.lang.String is not a java.awt.Image. Read
    the fucking Javadoc.

    > and why am i filling in "w" in
    > the end again?


    If you wrote the code, you ought to know best why.

    > http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html


    Unless you are really working with 1.4.2, use up-to-date documentation:
    <http://java.sun.com/javase/6/docs/api/>

    --
    DF.
    to reply privately, change the top-level domain
    in the FROM address from "invalid" to "net"
     
    Daniele Futtorovic, Jul 7, 2008
    #2
    1. Advertising

  3. ssecorp wrote:
    > I odnt get the exact complaint here. and why am i filling in "w" in
    > the end again?
    > http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html
    >
    >
    > import java.awt.image.PixelGrabber;
    >
    > public class Main {
    >
    > public static void main(String[] args) {
    > int w = 50;
    > int h = 50;
    > int[] pixels = new int[w * h];
    > PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
    > images/giffer.gif", 1, 1, w, h, pixels, 0, w);
    > }
    >
    > }
    >
    >
    > init:
    > deps-jar:
    > Compiling 1 source file to C:\Users\saftarn\Documents\NetBeansProjects
    > \JAItest\build\classes
    > C:\Users\saftarn\Documents\NetBeansProjects\JAItest\src\jaitest
    > \Main.java:11: cannot find symbol
    > symbol : constructor
    > PixelGrabber(java.lang.String,int,int,int,int,int[],int,int)
    > location: class java.awt.image.PixelGrabber
    > PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
    > images/giffer.gif", 1, 1, w, h, pixels, 0, w);
    > 1 error
    > BUILD FAILED (total time: 0 seconds)


    Lose the PixelGrabber it is only going to give you grief. Use the
    ImageIO class to read in your images and access the pixel data from the
    BufferedImage.

    --

    Knute Johnson
    email s/nospam/knute2008/

    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    Knute Johnson, Jul 8, 2008
    #3
  4. On Jul 8, 6:32 am, Daniele Futtorovic <>
    wrote:

    > >http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html

    >
    > Unless you are really working with 1.4.2, use up-to-date documentation:
    > <http://java.sun.com/javase/6/docs/api/>


    I sometimes have trouble producing direct links
    to the SE 6 JavaDocs when searching 'ClassName+javadoc'
    in a major search engine. It tends to throw up
    hits for 1.4.2.

    Perhaps that is where this '1.4' link originated from.

    --
    Andrew Thompson
    http://pscode.org/
     
    Andrew Thompson, Jul 8, 2008
    #4
  5. ssecorp

    Tom Anderson Guest

    On Tue, 8 Jul 2008, Andrew Thompson wrote:

    > On Jul 8, 6:32 am, Daniele Futtorovic <>
    > wrote:
    >
    >>> http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html

    >>
    >> Unless you are really working with 1.4.2, use up-to-date documentation:
    >> <http://java.sun.com/javase/6/docs/api/>

    >
    > I sometimes have trouble producing direct links to the SE 6 JavaDocs
    > when searching 'ClassName+javadoc' in a major search engine. It tends
    > to throw up hits for 1.4.2.
    >
    > Perhaps that is where this '1.4' link originated from.


    I think this is a very likely explanation. I assume that there are a lot
    of links out there on the web which point to the 1.4.2 docs, and thus
    these have more googlejuice than the newer ones.

    A tip someone here suggested a while ago, which i've found very useful, is
    to add 'SE-6' to your search, which means you'll always get the 1.6
    versions.

    tom

    --
    A military-industrial illusion of democracy
     
    Tom Anderson, Jul 8, 2008
    #5
  6. ssecorp

    ssecorp Guest

    import java.awt.image.BufferedImage;
    /**import java.awt.event.*;*/
    import java.awt.image.PixelGrabber;
    import java.io.File;


    public class Main {

    public static void main(String[] args) {
    int w = 50;
    int h = 50;
    int[] pixels = new int[w * h];
    /**BufferedImage image = BMPDecoder.read(new File("C:/users/
    saftarn/desktop/images/giffer.gif"));*/
    File pic = new File("C:/users/saftarn/desktop/images/
    giffer.gif");
    PixelGrabber pix = new PixelGrabber(pic, 1, 1, w, h, pixels,
    0, w);

    }

    }



    init:
    deps-jar:
    Compiling 1 source file to C:\Users\saftarn\Documents\NetBeansProjects
    \JAItest\build\classes
    C:\Users\saftarn\Documents\NetBeansProjects\JAItest\src\jaitest
    \Main.java:15: cannot find symbol
    symbol : constructor
    PixelGrabber(java.io.File,int,int,int,int,int[],int,int)
    location: class java.awt.image.PixelGrabber
    PixelGrabber pix = new PixelGrabber(pic, 1, 1, w, h, pixels,
    0, w);
    1 error
    BUILD FAILED (total time: 0 seconds)
     
    ssecorp, Jul 8, 2008
    #6
  7. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Tom Anderson schreef:
    |> I sometimes have trouble producing direct links to the SE 6 JavaDocs
    |> when searching 'ClassName+javadoc' in a major search engine. It tends
    |> to throw up hits for 1.4.2.
    |>
    |> Perhaps that is where this '1.4' link originated from.
    |
    | I think this is a very likely explanation. I assume that there are a lot
    | of links out there on the web which point to the 1.4.2 docs, and thus
    | these have more googlejuice than the newer ones.
    |
    | A tip someone here suggested a while ago, which i've found very useful,
    | is to add 'SE-6' to your search, which means you'll always get the 1.6
    | versions.

    Just ‘6’ suffices. But it’s still annoying.

    H.
    - --
    Hendrik Maryns
    http://tcl.sfs.uni-tuebingen.de/~hendrik/
    ==================
    http://aouw.org
    Ask smart questions, get good answers:
    http://www.catb.org/~esr/faqs/smart-questions.html
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

    iEYEARECAAYFAkhzaZQACgkQe+7xMGD3itRAAACfUcyyYsDzaoVM7VaiLW+p0qfH
    WQoAn2ODbvZJf8POE6A9EmwPVyYgvL+k
    =WSdW
    -----END PGP SIGNATURE-----
     
    Hendrik Maryns, Jul 8, 2008
    #7
  8. ssecorp

    Lew Guest

    Winifred Mansfield wrote:
    > On Jul 8, 6:32 am, Daniele Futtorovic <>
    > wrote:
    >
    >>> http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html

    >> Unless you are really working with 1.4.2, use up-to-date documentation:
    >> <http://java.sun.com/javase/6/docs/api/>

    >
    > I sometimes have trouble producing direct links
    > to the SE 6 JavaDocs when searching 'ClassName+javadoc'
    > in a major search engine. It tends to throw up
    > hits for 1.4.2.
    >
    > Perhaps that is where this '1.4' link originated from.


    Well, that and a functional resource to read what one is writing and think about
    whether the first search hit is the correct search hit.

    --
    Lew


    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [NWO, Skull and Bones, propaganda, brainwash, mind control,
    fanatic, puppet, President, war, terror, dictator, totalitarian,
    fascis, extremis]

    "The Bush family fortune came from the Third Reich."

    --- John Loftus, former US Justice Dept.
    Nazi War Crimes investigator and
    President of the Florida Holocaust Museum.
    Sarasota Herald-Tribune 11/11/2000:

    "George W's grandfather Prescott Bush was among the chief
    American fundraisers for the Nazi Party in the 1930s and '40s.
    In return he was handsomely rewarded with plenty of financial
    opportunities from the Nazis helping to create the fortune
    and legacy that his son George inherited."
     
    Lew, Jul 8, 2008
    #8
  9. On 2008-07-08 14:42 +0100, Tom Anderson allegedly wrote:
    > On Tue, 8 Jul 2008, Andrew Thompson wrote:
    >
    >> On Jul 8, 6:32 am, Daniele Futtorovic <>
    >> wrote:
    >>
    >>>> http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html
    >>>>
    >>>
    >>> Unless you are really working with 1.4.2, use up-to-date documentation:
    >>> <http://java.sun.com/javase/6/docs/api/>

    >>
    >> I sometimes have trouble producing direct links to the SE 6 JavaDocs
    >> when searching 'ClassName+javadoc' in a major search engine. It tends
    >> to throw up hits for 1.4.2.
    >>
    >> Perhaps that is where this '1.4' link originated from.

    >
    > I think this is a very likely explanation. I assume that there are a lot
    > of links out there on the web which point to the 1.4.2 docs, and thus
    > these have more googlejuice than the newer ones.


    It may be an explanation. I don't see, however, why an explanation is
    called for in this case.

    > A tip someone here suggested a while ago, which i've found very useful,
    > is to add 'SE-6' to your search, which means you'll always get the 1.6
    > versions.


    We're talking about 1.4 versus 1.6 here, ergo we're talking about the
    Java SE. In that case, I fail to understand why you want to access that
    documentation via a search engine. There's a perfectly usable main page
    for that:
    <http://java.sun.com/javase/6/docs/api/>

    Accessing the doc that way doesn't take more time than via a search
    engine. Accessing it via a search engine is rather absurd, IMHO, and
    more importantly a bad habit -- again: IMHO. Someone noted recently in
    this NG, I think, how people tended to disregard URLs and rely on the
    search engine input field more and more. I think that's a rather
    debilitating attitude. It's certainly an attitude that's encouraged by
    the major browsers, and Google is certainly a tremendously useful tool.
    Yet I dread the factuality of a Google monopoly of access to the web.
    They were able, to this day, to counter-balance such fears, seeing how
    they are relatively well-behaved. But beware of the beginnings.

    --
    DF.
    to reply privately, change the top-level domain
    in the FROM address from "invalid" to "net"
     
    Daniele Futtorovic, Jul 8, 2008
    #9
  10. On Jul 8, 6:32=A0am, Daniele Futtorovic <>
    wrote:

    > >http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html

    >
    > Unless you are really working with 1.4.2, use up-to-date documentation:
    > <http://java.sun.com/javase/6/docs/api/>


    I regardless have indirection constructing direct links
    to the SE 6 JavaDocs when searching 'ClassName+javadoc'
    in a major search aphrodesiac. It tends to throw up
    hits for 1.4.2.

    Perhaps that is where this '1.4' link subdued from.

    --
    Winifred MacNab
    http://pscode.org/


    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "Consider that language a moment.
    'Purposefully and materially supported hostilities against
    the United States' is in the eye of the beholder, and this
    administration has proven itself to be astonishingly
    impatient with criticism of any kind.

    The broad powers given to Bush by this legislation allow him
    to capture, indefinitely detain, and refuse a hearing to any
    American citizen who speaks out against Iraq or any other
    part of the so-called 'War on Terror.'

    "If you write a letter to the editor attacking Bush,
    you could be deemed as purposefully and materially supporting
    hostilities against the United States.

    If you organize or join a public demonstration against Iraq,
    or against the administration, the same designation could befall
    you.

    One dark-comedy aspect of the legislation is that senators or
    House members who publicly disagree with Bush, criticize him,
    or organize investigations into his dealings could be placed
    under the same designation.

    In effect, Congress just gave Bush the power to lock them
    up."

    -- William Rivers Pitt
     
    Andrew Thompson, Jul 8, 2008
    #10
  11. ssecorp

    Tom Anderson Guest

    On Tue, 8 Jul 2008, Daniele Futtorovic wrote:

    > On 2008-07-08 14:42 +0100, Tom Anderson allegedly wrote:
    >> On Tue, 8 Jul 2008, Andrew Thompson wrote:
    >>
    >>> On Jul 8, 6:32 am, Daniele Futtorovic <>
    >>> wrote:
    >>>
    >>>>> http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html
    >>>>
    >>>> Unless you are really working with 1.4.2, use up-to-date documentation:
    >>>> <http://java.sun.com/javase/6/docs/api/>
    >>>
    >>> I sometimes have trouble producing direct links to the SE 6 JavaDocs when
    >>> searching 'ClassName+javadoc' in a major search engine. It tends to throw
    >>> up hits for 1.4.2.
    >>>
    >>> Perhaps that is where this '1.4' link originated from.

    >>
    >> I think this is a very likely explanation. I assume that there are a lot of
    >> links out there on the web which point to the 1.4.2 docs, and thus these
    >> have more googlejuice than the newer ones.

    >
    > It may be an explanation. I don't see, however, why an explanation is
    > called for in this case.


    All unexplained things must be explained. This is a keystone of my faith.

    Or, as the rather more poetic Lord Kelvin put it:

    "Science is bound, by the everlasting vow of honour, to face fearlessly
    every problem which can be fairly presented to it."

    >> A tip someone here suggested a while ago, which i've found very useful, is
    >> to add 'SE-6' to your search, which means you'll always get the 1.6
    >> versions.

    >
    > We're talking about 1.4 versus 1.6 here, ergo we're talking about the
    > Java SE. In that case, I fail to understand why you want to access that
    > documentation via a search engine. There's a perfectly usable main page
    > for that:
    > <http://java.sun.com/javase/6/docs/api/>
    >
    > Accessing the doc that way doesn't take more time than via a search
    > engine.


    Yes, it does. I can type a one-letter search shortcut, the class name and
    the digit 6 into my address bar, hit return, click on the first link, and
    be reading the javadoc within a couple of seconds. Even if i had the home
    page bookmarked, it would take me longer than that to get to the package
    page.

    > Accessing it via a search engine is rather absurd, IMHO, and more
    > importantly a bad habit -- again: IMHO.


    I note your opinions, but i would be interested in more of an explanation
    (as i mentioned, i like explanations!). Why is it a bad habit, and why is
    it absurd?

    > Someone noted recently in this NG, I think, how people tended to
    > disregard URLs and rely on the search engine input field more and more.
    > I think that's a rather debilitating attitude.


    I think the exact opposite. I remember the web before search engines, and
    i remember when AltaVista was all we had. URLs are pointers; they're a
    vital part of the infrastructure, but not something i want to think about
    explicitly most of the time.

    > It's certainly an attitude that's encouraged by the major browsers, and
    > Google is certainly a tremendously useful tool. Yet I dread the
    > factuality of a Google monopoly of access to the web. They were able, to
    > this day, to counter-balance such fears, seeing how they are relatively
    > well-behaved. But beware of the beginnings.


    I agree here - google are in a position to do great harm if they want to.

    tom

    --
    REMOVE AND DESTROY
     
    Tom Anderson, Jul 8, 2008
    #11
  12. On 2008-07-09 00:33 +0100, Tom Anderson allegedly wrote:
    > On Tue, 8 Jul 2008, Daniele Futtorovic wrote:
    >
    >> On 2008-07-08 14:42 +0100, Tom Anderson allegedly wrote:
    >>> On Tue, 8 Jul 2008, Andrew Thompson wrote:
    >>>> Perhaps that is where this '1.4' link originated from.
    >>>
    >>> I think this is a very likely explanation. I assume that there are a
    >>> lot of links out there on the web which point to the 1.4.2 docs, and
    >>> thus these have more googlejuice than the newer ones.

    >>
    >> It may be an explanation. I don't see, however, why an explanation is
    >> called for in this case.

    >
    > All unexplained things must be explained. This is a keystone of my faith.
    >
    > Or, as the rather more poetic Lord Kelvin put it:
    >
    > "Science is bound, by the everlasting vow of honour, to face fearlessly
    > every problem which can be fairly presented to it."


    Looking for an explanation in this case implied that it was actually a
    problem. I didn't see it a such. It might have been a mistake, but then
    again it might have been on purpose. Justification always implies some
    measure of blame -- not necessarily sensibly so, but nevertheless. In
    this sense, out of politeness, I didn't think it was necessary to look
    for an explanation.

    Please also allow me to nitpick and note that science and faith are
    contradictory. Faith always implies some amount of inexplicableness.

    >>> A tip someone here suggested a while ago, which i've found very
    >>> useful, is to add 'SE-6' to your search, which means you'll always
    >>> get the 1.6 versions.

    >>
    >> We're talking about 1.4 versus 1.6 here, ergo we're talking about the
    >> Java SE. In that case, I fail to understand why you want to access that
    >> documentation via a search engine. There's a perfectly usable main page
    >> for that:
    >> <http://java.sun.com/javase/6/docs/api/>
    >>
    >> Accessing the doc that way doesn't take more time than via a search
    >> engine.

    >
    > Yes, it does. I can type a one-letter search shortcut, the class name
    > and the digit 6 into my address bar, hit return, click on the first
    > link and be reading the javadoc within a couple of seconds. Even if i
    > had the home page bookmarked, it would take me longer than that to get
    > to the package page.


    If I know the package, it takes me two clicks and some mouse wheeling to
    access it via the JSE Javadoc page. But nevermind. I suppose YMMV.

    >> Accessing it via a search engine is rather absurd, IMHO, and more
    >> importantly a bad habit -- again: IMHO.

    >
    > I note your opinions, but i would be interested in more of an
    > explanation (as i mentioned, i like explanations!). Why is it a bad
    > habit, and why is it absurd?


    The absurdity lies in using a tool which is supposed to find content in
    various pages to find /specific pages/. You left the part where you have
    to validate the search results visually out of your description. I won't
    deny it's only a very slight absurdity, however.

    As for the bad habit part, see "debilitating" below.

    >> Someone noted recently in this NG, I think, how people tended to
    >> disregard URLs and rely on the search engine input field more and
    >> more. I think that's a rather debilitating attitude.

    >
    > I think the exact opposite. I remember the web before search engines,
    > and i remember when AltaVista was all we had. URLs are pointers; they're
    > a vital part of the infrastructure, but not something i want to think
    > about explicitly most of the time.


    I remember those times too, and am all the more grateful towards Google
    for that.

    Nevertheless, I am uncomfortable with anything that obstructs
    understanding. Google or not, the web is built around URLs. I deal with
    people often enough who don't even understand what an URL or a domain or
    a site are, because they're used to simply type some keywords in the
    search input field (often integrated into the browser itself), and click
    on links -- not even aware that some of those are ads.

    Furthermore, you might be in for some surprises if some nefarious joker
    (me, for instance) were able to lay his hands on a proxy between you and
    the web, and tamper with the search results page, and with minimal effort.

    --
    DF.
    to reply privately, change the top-level domain
    in the FROM address from "invalid" to "net"
     
    Daniele Futtorovic, Jul 9, 2008
    #12
  13. ssecorp

    Roedy Green Guest

    On Mon, 7 Jul 2008 13:02:05 -0700 (PDT), ssecorp
    <> wrote, quoted or indirectly quoted someone
    who said :

    >symbol : constructor
    >PixelGrabber(java.lang.String,int,int,int,int,int[],int,int)
    >location: class java.awt.image.PixelGrabber
    > PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
    >images/giffer.gif", 1, 1, w, h, pixels, 0, w);


    It is telling you there is no constructor with that signature.

    see
    http://mindprod.com/jgloss/compileerrormessages.html#CANNOTFINDSYMBOL
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Jul 9, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. codehead
    Replies:
    3
    Views:
    411
    codehead
    Jun 13, 2005
  2. Replies:
    2
    Views:
    441
  3. Thomas McLean

    Python complaining about CherryPY?

    Thomas McLean, Aug 19, 2006, in forum: Python
    Replies:
    0
    Views:
    361
    Thomas McLean
    Aug 19, 2006
  4. Replies:
    6
    Views:
    477
  5. Replies:
    4
    Views:
    335
    Falcon Kirtaran
    Mar 9, 2008
Loading...

Share This Page