Please Help With ActionListener
..............................
Re: Please Help With ActionListener
Please don't paraphrase the error message, but rather when asking here, show the actual error message in its entirety so we don't have to guess what's really wrong. So, speaking of guessing, I'm going to guess now: do you import ActionListener?
Re: Please Help With ActionListener
Yes your guess was correct. I am now having another problem.
Code:
displayMessage = new JLabel (guiDie1.getMessage()); //cannot find symbol - method getMessage()
In that line.
Re: Please Help With ActionListener
Again, please show the entire error message.
Also show the pertinent code. I don't even see where you declare the variable you're using on that line. Your class's code is not fully shown in your post.
Thanks.
Re: Please Help With ActionListener
Quote:
Originally Posted by
Fubarable
Again, please show the entire error message..
Thanks.
Give me an example of showing the entire error message...im confused.
Re: Please Help With ActionListener
Re: Please Help With ActionListener
Test.java:5: ';' expected
Scanner kybd = new Scanner(System.in)
^
1 error
The full message provides useful info such as the class and line number where it occurs. it also attempts to place the ^ reasonably close to exactly where on the line the error is.
Re: Please Help With ActionListener
Quote:
Originally Posted by
Junky
Test.java:5: ';' expected
Scanner kybd = new Scanner(System.in)
^
1 error
The full message provides useful info such as the class and line number where it occurs. it also attempts to place the ^ reasonably close to exactly where on the line the error is.
How do you get it show the error message like that? Im using BlueJ.
Re: Please Help With ActionListener
Your code has changed?!
You were posting:
Code:
displayMessage = new JLabel (guiDie1.getMessage());
And now your posting:
Code:
displayMessage = new JLabel (GVDie1.getMessage());
This is getting too confusing for me.
Re: Please Help With ActionListener
Where in the GVdie class is the getMessage method?
Re: Please Help With ActionListener
Quote:
Originally Posted by
Fubarable
Your code has changed?!
You were posting:
Code:
displayMessage = new JLabel (guiDie1.getMessage());
And now your posting:
Code:
displayMessage = new JLabel (GVDie1.getMessage());
This is getting too confusing for me.
I changed it due to not correctly naming it in the first place. GVDie is the correct name. Sorry.
Re: Please Help With ActionListener
So the error is telling your that your GVdie class doesn't have a getMessage() method, not with that message signature. So the obvious place to look is in the ... GVdie class. Does it have such a method with the correct signature? The error messages aren't very cryptic and usually tell you exactly what's wrong -- as is the case here.
Re: Please Help With ActionListener
Quote:
Originally Posted by
Daman12
How do you get it show the error message like that? Im using BlueJ.
By compiling on the command line. It has been awhile since I used BlueJ so I cannot remember but most IDE's have a console window (or similar) for displaying messages.
Re: Please Help With ActionListener
No there isnt a method with that signature. I was provided the GVdie class and have to use the one provided for the program. getMessage isnt in GVdie class....but i need it to display the current message.
Re: Please Help With ActionListener
Well you cannot call a method that does not exist. So either call a method that does exist or change what you are trying to do.
Re: Please Help With ActionListener
Would anyone be able to help me on MSN or another form of messenger? This project is due tomorrow.
Re: Please Help With ActionListener
What's wrong with the help you are getting so far?
Re: Please Help With ActionListener
Quote:
Originally Posted by
Junky
What's wrong with the help you are getting so far?
Nothing there is just more to the code that is wrong and its hard to keep pasting it all here. I dont want it to be confusing. If someone could one on one help me that would be great. There is 4 different classes in this program and im having some trouble linking them all together correctly.
Re: Please Help With ActionListener
Quote:
Originally Posted by
Daman12
Would anyone be able to help me on MSN or another form of messenger? This project is due tomorrow.
We are all volunteers and so our time is valuable to us, and I doubt anyone will be able to IM you. If you have a question, then ask it and we'll help as best you can.
Re: Please Help With ActionListener
Quote:
Originally Posted by
Daman12
Nothing there is just more to the code that is wrong and its hard to keep pasting it all here. I dont want it to be confusing. If someone could one on one help me that would be great. There is 4 different classes in this program and im having some trouble linking them all together correctly.
You'd be fastest to try to debug most of this yourself. Again, look carefully at the error messages as they often tell you most of what you need to know.
You may also want to start your projects a little earlier next time. :)