What is the compiler complaining about?

S

ssecorp

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)
 
D

Daniele Futtorovic

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.

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

Knute Johnson

ssecorp said:
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.
 
A

Andrew Thompson

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.
 
T

Tom Anderson

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
 
S

ssecorp

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)
 
H

Hendrik Maryns

-----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-----
 
L

Lew

Winifred said:
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."
 
D

Daniele Futtorovic

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.
 
A

Andrew Thompson

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
 
T

Tom Anderson

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."
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
 
D

Daniele Futtorovic

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.
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.
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.
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top