I'm trying to make a program that will toggle a boolean value and paint a red rectangle on the right side of a swing panel when you press the 'a' key. Unfortunately, I'm not having much luck, because when I hit 'a' nothing happens. My mistake is probably something obvious that I'll know how to fix once someone points it out for me, but for the life of me, I can't find it. If someone could look over my code and figure out what's wrong, I'd very much appreciate it. I've attached my source code below.
nocookies92
0
Newbie Poster
Recommended Answers
Jump to PostFirst thing is try to debug the code by adding println()s to see where the code is executing.
The code does not compile:ClickyLatinHelp.java:78: cannot find symbol symbol : class Lists location: class ClickyLatinHelp.DrawingArea Lists listhi = new Lists(); ^ ClickyLatinHelp.java:78: cannot find symbol symbol : class …
Jump to PostHave you tried debugging your code using println()s?
the obvious questions:
Do you have key listeners?
are they connected to any components?
Does the component have focus?
All 8 Replies
NormR1
563
Posting Sage
Team Colleague
nocookies92
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
nocookies92
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
nocookies92
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
nocookies92
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.