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?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.