Theinput in a JTextField must be used in the variable Color color.
input = YELLOW must change variable color in Color.YELLOW.
My attempt does not work:
cor.vandijk.779 0 Newbie Poster
Recommended Answers
Jump to PostIf you don't show us your code we cannot tell you what's wrong with it.
Jump to PostWhen you see
Color.xxx
thexxx
is the name of a public variable in theColor
class. You can't just use a String variable as the name like that.
There are (at least) two ways to do what you want:
1. Create a Map<String, Color> that has the string as a …
All 7 Replies
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
cor.vandijk.779 0 Newbie Poster
NormR1 563 Posting Sage Team Colleague
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
cor.vandijk.779 0 Newbie Poster
cor.vandijk.779 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured 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.