Reputation: 23
This is my first Swing project on Eclipse, and I cannot set the background color of a component. I have tried by using this code :
B_Send.setBackground(new java.awt.color(0,0,255));
which returns the error:
java.awt.color cannot be resolved to a type
Can anyone explain the error and why the code isn't working?
Upvotes: 1
Views: 1248
Reputation: 285405
It's not java.awt.color
but rather java.awt.Color
.
Yes, these little things mean a lot, and the Java compiler is extremely persnickety. Welcome to the world of programming.
Upvotes: 6