I don't understand the error

S

ssecorp

what is the problem here?




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: 1 second)
 
T

Tom Anderson

what is the problem here?

That's what we call a PEBKAC.

HTH. HAND.

tom
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: 1 second)
 
S

Stefan Ram

ssecorp said:
PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/

Here is an example how PixelGrabber is used to read from an
image, copied from an old program of mine. I have removed some
parts (like exception handling) for simplification and not
tested it afterwards.

final java.awt.image.BufferedImage image =
javax.imageio.ImageIO.read( file );

final int[] data = new int[ image.getWidth() * image.getHeight() ];

final java.awt.image.PixelGrabber pixelGrabber =
new java.awt.image.PixelGrabber
( image, 0, 0, image.getWidth(), image.getHeight(),
data, 0, image.getWidth() );

pixelGrabber.grabPixels();
 
M

Mark Space

ssecorp said:
what is the problem here?

Java error messages can be verbose, but they're not hard to read if you
look closely. Tom was unfortunately needlessly rude and unhelpful in his
remark.

\Main.java:11: cannot find symbol
symbol : constructor

This bit tells you that the constructor is the problem. That's the
thing you call "new" on.
PixelGrabber(java.lang.String,int,int,int,int,int[],int,int)

This is the constructor it was looking for. This is how you called it.

** If you look at the API with the line above in mind, you'll see that
there are no constructors that take a String as their first argument.
So that's the problem right there. **
location: class java.awt.image.PixelGrabber

Package and class name of the class the compiler was looking for. This
is what the compiler thought you meant.
PixelGrabber pix = new PixelGrabber("C:/users/saftarn/desktop/
images/giffer.gif", 1, 1, w, h, pixels, 0, w);

This is a copy of the line you typed, for your reference.

In NetBeans, clicking on the error message will send you right to the
line so you can find it easily.
 
G

GArlington

what is the problem here?

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);
}

}

Read your error message carefully (thinking about what it actually
says).
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
The "symbol" (i.e. var or function or ... something you are trying to
use) is NOT defined OR is NOT defined the way you are trying to use it
(defined differently)
symbol : constructor
Hurah! It even tells you which "symbol" - constructor
PixelGrabber(java.lang.String,int,int,int,int,int[],int,int)
Hurah!!! It shows you how you are trying to use the "symbol", so all
you need to do is to compare your usage to constructors in TFM
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html
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: 1 second)
Can you see what the problem is???
 
T

Tom Anderson

No, it was accurate. A quick glance at the javadoc would have resolved
this problem in seconds, but the OP was too lazy or stupid to do it.
Assisting someone who refuses to do even that is not helping them - it's
enabling their damaged and ultimately self-destructive behaviour.
\Main.java:11: cannot find symbol
symbol : constructor

This bit tells you that the constructor is the problem. That's the thing
you call "new" on.
PixelGrabber(java.lang.String,int,int,int,int,int[],int,int)

This is the constructor it was looking for. This is how you called it.

** If you look at the API with the line above in mind, you'll see that
there are no constructors that take a String as their first argument. So
that's the problem right there. **

This is the same answer the OP got the *first* time he asked the
question. In fact, the answer was posted over 45 minutes prior to the
repost of the question.

The real WTF is that he's even using PixelGrabber in the first place.

tom
 
A

Andrew Thompson

what is the problem here? ...

Reposting questions. Please read the answers
you have otherwise got on..
ead/4a41eed296d9d749/c0f6c7affb3dc451?hl=3Den#c0f6c7affb3dc451

--
Eliza Pierce
http://pscode.org/


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"For every fatal shooting, there were roughly three non-fatal
shootings. And, folks, this is unacceptable in America.
It's just unacceptable. And we're going to do something about it."

--- Adolph Bush,
Philadelphia, May 14, 2001
(Thanks to John Brooks.)
 
M

Mark Space

Tom said:
No, it was accurate. A quick glance at the javadoc would have resolved
this problem in seconds, but the OP was too lazy or stupid to do it.

I read this news group in reverse order, ie., most recent post first, so
I actually didn't see the OP's first post and the replies.
Nevertheless, your reply didn't add anything. It wasted my time to read
it, and it wasted the time of anyone else who read it also.

Trolls are a problem here on this news group, and people who feel
compelled to respond in a trollish manner are also contributing to the
problem. Please don't. If anything you would put in a reply to a post
doesn't address Java in a constructive manner, just don't bother.

Also, everyone should refrain from personal attacks, such as calling
people lazy and stupid. This is just trolling, plain and simple. If it
ain't Java, it doesn't need to get posted, and commenting on other
people's intelligence has nothing at all to do with Java.


Lew I'm going to reply here since your post got canceled by the East
European troll. As I mentioned, I read this thread first, before
noticing the other thread. If I had noticed the other thread first, I
probably wouldn't've replied at all.

To everyone:

I think in general we all need to keep the subject on Java, and ignore
the trolls here. The OP may or may not be trolling. I'd like to assume
that he had some sort of problem with his newsreader, and didn't see the
replies. His repost could be an honest mistake. It's best to give
people a break, I think, until we're certain that they are trolling.
Then just ignore them.
 
D

Daniele Futtorovic

I read this news group in reverse order, ie., most recent post first, so
I actually didn't see the OP's first post and the replies.

Your problem.
Nevertheless,
your reply didn't add anything.

In your opinion.
It wasted my time to read it,

That's tough, but I rather doubt it's an isolated case.
and it
wasted the time of anyone else who read it also.

That's not for you to decide.
Trolls are a problem here on this news group, and people who feel
compelled to respond in a trollish manner are also contributing to the
problem. Please don't. If anything you would put in a reply to a post
doesn't address Java in a constructive manner, just don't bother.

Also, everyone should refrain from personal attacks, such as calling
people lazy and stupid. This is just trolling, plain and simple. If it
ain't Java, it doesn't need to get posted, and commenting on other
people's intelligence has nothing at all to do with Java.

The akachan ningen OP displayed lazy and stupid, and altogether rude,
behaviour. How each NG attendant deals with other attendants' behaviour
is up to them. You choose the way you deem best. Other choose ways they
deem best. That's democracy. Deal with it.
Then you can get into discussions /why/ a specific way of dealing with a
specific behavioural pattern is better than another. Although I
personally would judge such arguments superfluous (seeing how the issue
has already been discussed at lengths, and has led to the
crystallisation of what's commonly referred to as "netiquette" and
related heuristics), I don't think it's necessarily counter-productive
to rehash true things from time to time.
Your take on what should be discussed and what should not would prohibit
any such discussions. In fact, taken to the extreme, it would render all
discussions in this NG almost meaningless.
I don't see it as a problem, however, for the simple reason that you
have no way of enforcing your rules. I think that's a Good Thing. Please
take these remarks of mine as a simple reminder that posting to enforce
such rules will merely prompt postings which deny such rules, generate
traffic and as such, defy your purpose.

If you feel you or someone else has been wronged, decide whether you
wish to counter-balance what someone else did. One voice is what you
have at your disposal, and you are not alone. You are one ball in a bowl
of balls, which is more than nothing, but less than everything. The
result is the sum of its parts, plus/minus synergies. I think that's
great, personally. While you are free to disagree with how I see it, be
aware of how it is.
 
A

Arne Vajhøj

Tom said:
No, it was accurate. A quick glance at the javadoc would have resolved
this problem in seconds, but the OP was too lazy or stupid to do it.
Assisting someone who refuses to do even that is not helping them - it's
enabling their damaged and ultimately self-destructive behaviour.

And if you think name calling is going to improve the situation,
then your people skills are as bad as the original posters Java
skills. But where it is the norm that people improve their Java
skills over time, then the same can not be said about people skills.

Everybody has to learn programming in Java. And the beginning can
be troublesome. The original poster did post code showing the
problem and the complete error message, but chose cljp instead
og cljh. But that is 2 out 3 correct. I believe that is above
average.

So why not relax a bit - if you see a question like that then
either explain politely or just go on to next question and leave
it to somebody else to answer it.

Arne
 
A

Arne Vajhøj

Daniele said:
The akachan ningen OP displayed lazy and stupid, and altogether rude,
behaviour.

What are you smoking ?

The OP asked "what is the problem here?" and supplied
complete code and a complete error message.

I find it very difficult to see that as rude.

Arne
 
D

Daniele Futtorovic

What are you smoking ?

Mild Old Holborn. And you?
The OP asked "what is the problem here?" and supplied complete code
and a complete error message.

20080707T18:43: OP asks how to get pixel data from an Image. OP gets a
hint to PixelGrabber. OP abandons thread.

20080707T20:02: OP posts some code with a PixelGrabber and a compiler
error, which make it blatantly clear he hasn't got the merest clue of
what he's doing and can't be bothered to read and/or understand the
Javadoc. OP receives answers to that effect.

20080707T21:16: After having received those answers, OP reposts the
*exact* same problem. OP receives some answers explaining the
problem, and some criticising his behaviour.

20080708T13:14: OP makes a random modification to his code, posts that
code and the inevitable compiler error. Not even a hint of text or a
question this time.

Those are *all* the posts from user "ssecorp" to this matter.
I find it very difficult to see that as rude.

I respect that, but that's not how I see it. That being said, please be
aware that I wouldn't go such lengths over it hadn't it been for Mark
Space's remarks and your question. I propose that we let the matter rest.
 
A

Arne Vajhøj

Daniele said:
20080707T18:43: OP asks how to get pixel data from an Image. OP gets a
hint to PixelGrabber. OP abandons thread.

20080707T20:02: OP posts some code with a PixelGrabber and a compiler
error, which make it blatantly clear he hasn't got the merest clue of
what he's doing and can't be bothered to read and/or understand the
Javadoc. OP receives answers to that effect.

20080707T21:16: After having received those answers, OP reposts the
*exact* same problem. OP receives some answers explaining the
problem, and some criticising his behaviour.

20080708T13:14: OP makes a random modification to his code, posts that
code and the inevitable compiler error. Not even a hint of text or a
question this time.

Those are *all* the posts from user "ssecorp" to this matter.

And that relates to the claim of being lazy and stupid for not
solving ones problems by reading docs how ??

Or do you just believe that because someone not followed
netiquette that they are fair game for anyone ??
I respect that, but that's not how I see it. That being said, please be
aware that I wouldn't go such lengths over it hadn't it been for Mark
Space's remarks and your question. I propose that we let the matter rest.

For some reasons the pigs that like to bully the newbies often prefer
to let the matter rest when someone speaks up against it.

Arne
 
D

Daniele Futtorovic

And that relates to the claim of being lazy and stupid for not
solving ones problems by reading docs how ??

Apparently not at all, in your opinion; quite a bit, in my opinion.
Or do you just believe that because someone not followed
netiquette that they are fair game for anyone ??

That's beside the point. Everybody is a "fair game" for everyone. You,
me, ssecorp.
For some reasons the pigs that like to bully the newbies often prefer
to let the matter rest when someone speaks up against it.

Non sequitur (I, purported "pig that like bully the newbies", would have
let it rest anyhow). But think what you will.
I shall nevertheless be honoured each time you will speak your opinion
if you think I or someone else behaved wrongly. Don't expect it to do
any magic, though.
 
T

Tom Anderson

And that relates to the claim of being lazy and stupid for not solving
ones problems by reading docs how ??
Directly.

Or do you just believe that because someone not followed netiquette that
they are fair game for anyone ??

If someone comes up to me and says "How do i hammer a nail into this
wood?", and i tell them to use a hammer, and show them where to find one
and how to use it, and then a bit later they come back and say "This
doesn't work, how do i do this?", *while holding a spanner*, then i think
they're stupid. If i also gave them a book on how to use hammers, i think
they're also lazy.
For some reasons the pigs that like to bully the newbies often prefer to
let the matter rest when someone speaks up against it.

I don't know if i'm one of the pigs being referred to here. I did more to
help the guy with his problem than anyone else, up to and including
posting actual code, and then i got pissed off when he ignored my help and
kept asking stupid questions. When people who hadn't actually contributed
anything useful to the thread started telling me off, i decided the best
thing for signal to noise ratio was to keep my mouth shut. I think Mark
was off-beam in his criticism, but i saw no point in getting into a fight
about it. Nobody ever changed anyone's opinion about anything by arguing
on usenet, so why bother?

I've just posted another response to the same question yet again, which i
assume is from the same guy under a different name. It's a little curt,
but it is a complete answer. Let's see what happens.

tom
 
C

conrad

Tom said:
I don't know if i'm one of the pigs being referred to here. I did more to
help the guy with his problem than anyone else, up to and including
posting actual code, and then i got pissed off when he ignored my help and
kept asking stupid questions. When people who hadn't actually contributed
anything useful to the thread started telling me off, i decided the best
thing for signal to noise ratio was to keep my mouth shut. I think Mark
was off-beam in his criticism, but i saw no point in getting into a fight
about it. Nobody ever changed anyone's opinion about anything by arguing
on usenet, so why bother?

I've just posted another response to the same question yet again, which i
assume is from the same guy under a different name. It's a little curt,
but it is a complete answer. Let's see what happens.

In support of Tom's points, this is clj.programmer, presumptively
where professionals hang out to discuss Java matters, and occasionally
get fine points of the language clarified. It is the height of
rudeness to come in demanding help, then completely disregard the
voluntary, unpaid, donated, generous efforts of the Tom Andersons of
this group to help. It is also the height of ego to take offense at
anything said on Usenet. Even if someone where to publish here, "Lew,
you are completely arrogant, condescending and useless", as certain
small people actually have done, it would be silly of me to be
offended. That's the way the game is played on Usenet. There's no
censorship, and the only recourse one has for another's behavior is to
speak one's mind. When a serf calls me "arrogant" or "condescending",
I give it all the consideration it's due and move on. If someone
points out, as has also happened, that I've misinterpreted a post or
done a disservice, I have the option to assimilate the advice and
modify my behavior. It's a beautiful thing.

So when the OP was told that ignoring good advice is lazy, stupid, or
whatever, they can take that with the mineful of salt it seems to
deserve, or take the advice to take the advice. If they do the
latter, of course, they will benefit immeasurably. Beating up someone
like Tom or whomever for "beating up the newbies" is silliness. The
OP actually was wrong to ignore the advice they had requested.
 
A

Arne Vajhøj

Tom said:
Directly.

That I find very difficult to see.
If someone comes up to me and says "How do i hammer a nail into this
wood?", and i tell them to use a hammer, and show them where to find one
and how to use it, and then a bit later they come back and say "This
doesn't work, how do i do this?", *while holding a spanner*, then i
think they're stupid. If i also gave them a book on how to use hammers,
i think they're also lazy.

I think you need to try and learn something completely new like
chinese language or playing the violin.

You may find out that what is obvious for those that do know may
be complete magick for those that do not know.
I don't know if i'm one of the pigs being referred to here.

You called someone that you have very good indications is a newbie
lazy or stupid (I do not recognize the original acronyms).

That is unacceptable behavior among civilized people.
> I did more
to help the guy with his problem than anyone else, up to and including
posting actual code, and then i got pissed off when he ignored my help
and kept asking stupid questions.

This is usenet.

There will always be a lot of newbies that are completely clueless
about the topic, how to troubleshoot and how to act on a newsgroup.

If you consider your effort futile then drop the assistance and
let somebody else do the work.
> When people who hadn't actually
contributed anything useful to the thread started telling me off, i
decided the best thing for signal to noise ratio was to keep my mouth
shut. I think Mark was off-beam in his criticism, but i saw no point in
getting into a fight about it. Nobody ever changed anyone's opinion
about anything by arguing on usenet, so why bother?

But you thought name calling at a newbie would ?

Arne
 
A

Arne Vajhøj

In support of Tom's points, this is clj.programmer, presumptively
where professionals hang out to discuss Java matters, and occasionally
get fine points of the language clarified. It is the height of
rudeness to come in demanding help, then completely disregard the
voluntary, unpaid, donated, generous efforts of the Tom Andersons of
this group to help. It is also the height of ego to take offense at
anything said on Usenet. Even if someone where to publish here, "Lew,
you are completely arrogant, condescending and useless", as certain
small people actually have done, it would be silly of me to be
offended. That's the way the game is played on Usenet. There's no
censorship, and the only recourse one has for another's behavior is to
speak one's mind. When a serf calls me "arrogant" or "condescending",
I give it all the consideration it's due and move on. If someone
points out, as has also happened, that I've misinterpreted a post or
done a disservice, I have the option to assimilate the advice and
modify my behavior. It's a beautiful thing.

So you don't think good manners apply to usenet.

I disagree.
So when the OP was told that ignoring good advice is lazy, stupid, or
whatever,

That is a twist of what was written. He was not told that certain
behavior was such - he was told that he was.

Arne
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top