Color []color = new Color[2];
color[0] = Color.red;
.....
color[0] = Color.red;
.....
解决方案 »
- Java中generic根据条件初始化的问题
- 关clone问题
- Substance
- 请问 类名之后的<> 是什么意思?
- 这样写为什么就不能连接上数据库,是不是类之间的关系放的不对?
- Java每天开发代码量多少行比较合适
- 高分请教银行socket问题!!几乎崩溃。。。。
- 急!用jdbc连接sql2000
- 文件操作问题
- JTable里面点击cell下拉JTable
- 急急!在BMP如何建立与数据库的连接?好像不是访问DataSource而是Connect pool,怎么做呢?
- jdbc访问access数据库时,调用getPropertyInfo方法,为什么抛出“Microsoft ODBC驱动管理器不支持此方法”的异常?
>varColor[0]=Color.red;
^ ^
>varColor[1]=Color.blue;
^ ^
>varColor[2]=Color.yellow;
^ ^赋值时出错:
期望 "]"
和
期望 <indentifier>如何办?
color[0] = Color.red;
color[1] = Color.blue;
color[2] = Color.yellow;没有什么错误,可能是你多写或少写了怎么符号!再查检程序
Color.getColor(String[])无法设置,我想这个函数应该可以吧
可能我用错了,请教
Finds a color in the system properties. The argument is treated as the name of a system property to be obtained. The string value of this property is then interpreted as an integer which is then converted to a color. If the specified property is not found, or could not be parsed as an integer, then null is returned.Parameters:
nm - the name of the color property
Returns:
the color value of the property.
问题已经解决应该是
color=new Color(Integer.parseInt(string,16));
不过还是谢谢各位回答