我来我网
https://5come5.cn
 
您尚未 登录  注册 | 菠菜 | 软件站 | 音乐站 | 邮箱1 | 邮箱2 | 风格选择 | 更多 » 
 

苜蓿



性别: 美女 状态: 该用户目前不在线
等级: 品行端正
发贴: 190
威望: 0
浮云: 1140
在线等级:
注册时间: 2007-10-22
最后登陆: 2008-06-27

5come5帮你背单词 [ theater // n. 戏院,剧院 ]


JAVA编译问题

高手帮看下.不胜感激
编译报错
F:\javalesson>javac changecolor.java
changecolor.java:31: incompatible types
found  : java.awt.Scrollbar
required: java.awt.Scrollbar[]
                        scrBar=new Scrollbar(Scrollbar.VERTICAL);
                              ^
changecolor.java:32: cannot resolve symbol
symbol  : method add  (java.awt.Scrollbar[])
location: class changecolor
                        add(scrBar);
                        ^
changecolor.java:33: cannot resolve symbol
symbol  : method reshape  (int,int,int,int)
location: class java.awt.Scrollbar[]
                        scrBar.reshape(100+80*i,5,20,160);
                              ^
changecolor.java:34: cannot resolve symbol
symbol  : method setValues  (int,int,int,int)
location: class java.awt.Scrollbar[]
                        scrBar.setValues(50,0,0,10);
                              ^
changecolor.java:35: cannot resolve symbol
symbol  : method getValue  ()
location: class java.awt.Scrollbar[]
                        labelColor=new Label(Text+scrBar.getValue(),Label.LEFT);

                                                        ^
changecolor.java:35: incompatible types
found  : java.awt.Label
required: java.awt.Label[]
                        labelColor=new Label(Text+scrBar.getValue(),Label.LEFT);

                                  ^
changecolor.java:36: cannot resolve symbol
symbol  : method add  (java.awt.Label[])
location: class changecolor
                        add(labelColor);
                        ^
changecolor.java:37: cannot resolve symbol
symbol  : method setBackground  (java.awt.Color)
location: class java.awt.Label[]
                        labelColor.setBackground(Color.green);
                                  ^
changecolor.java:38: cannot resolve symbol
symbol  : method reshape  (int,int,int,int)
location: class java.awt.Label[]
                        labelColor.reshape(100+80*i,165,40,20);
                                  ^
changecolor.java:64: cannot resolve symbol
symbol  : method getValue  ()
location: class java.awt.Scrollbar[]
                labelColor.setText(Text+scrBar.getValue());
                                              ^
changecolor.java:64: cannot resolve symbol
symbol  : method setText  (java.lang.String)
location: class java.awt.Label[]
                labelColor.setText(Text+scrBar.getValue());
                          ^
changecolor.java:73: cannot resolve symbol
symbol  : method getValue  ()
location: class java.awt.Scrollbar[]
                        value=(float)(scrBar.getValue()/100f);
                                            ^
changecolor.java:73: incompatible types
found  : float
required: float[]
                        value=(float)(scrBar.getValue()/100f);
                              ^
Note: changecolor.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
13 errors
问一下什么原因,怎么改
源码
import java.awt.*;
import java.applet.*;
import vrml.external.Browser;
import vrml.external.Node;
import vrml.external.field.EventInSFColor;
public class changecolor extends Applet{
        Scrollbar scrBar[]=new Scrollbar[3];
        Label labelColor[]=new Label[3];
        Label labelDemo;
        Browser browser;
        Node myMaterial;
        String Text[]={"R=","G=","B="};
        boolean isScenceLoading=true;
        public void start(){
                while (isScenceLoading){
                        try{
                                browser=Browser.getBrowser(this);
                                myMaterial=(Node)(browser.getNode("ConeColor"));
                                isScenceLoading=false;
                                labelDemo.setText("TestColor");
                        }
                        catch(Exception e){labelDemo.setText("VRML Loading");}
                }
        }
        public void init(){
                super.init();
                setLayout(null);
                resize(240,240);
                setBackground(Color.orange);
                for(int i=0;i<3;i++){
                        scrBar=new Scrollbar(Scrollbar.VERTICAL);
                        add(scrBar);
                        scrBar.reshape(100+80*i,5,20,160);
                        scrBar.setValues(50,0,0,10);
                        labelColor=new Label(Text+scrBar.getValue(),Label.LEFT);
                        add(labelColor);
                        labelColor.setBackground(Color.green);
                        labelColor.reshape(100+80*i,165,40,20);
                }
                labelDemo=new Label("TestColor",Label.CENTER);
                add(labelDemo);
                labelDemo.reshape(320,70,80,80);
                labelDemo.setBackground(new Color(122,122,122));
        }
        public boolean handleEvent(Event event){
                for(int i=0;i<3;i++){
                        if (event.id==Event.SCROLL_LINE_UP&&event.target==scrBar){
                                setColorLabel(event,i);
                                return true;
                        }
                        else if(event.id==Event.SCROLL_LINE_DOWN&&event.target==scrBar){
                                setColorLabel(event,i);
                                return true;
                        }
                        else if(event.id==Event.SCROLL_ABSOLUTE&&event.target==scrBar){
                                setColorLabel(event,i);
                            return true;
                        }
                }
                return super.handleEvent(event);
        }
        public void setColorLabel(Event ev,int i){
                Color demoColor;
                labelColor.setText(Text+scrBar.getValue());
                demoColor=new Color((int)(2.55*scrBar[0].getValue()),
                        (int)(2.55*scrBar[1].getValue()),
                        (int)(2.55*scrBar[2].getValue())
                        );
                labelDemo.setBackground(demoColor);
                float value[]=new float[3];
                EventInSFColor newColor=(EventInSFColor)myMaterial.getEventIn("set_diffuseColor");
                for(i=0;i<3;i++)
                        value=(float)(scrBar.getValue()/100f);
                newColor.setValue(value);
        }
}
顶端 Posted: 2008-04-22 12:15 | [楼 主]
wsf



性别: 帅哥 状态: 该用户目前不在线
头衔: keep the faith
等级: 前途无量
发贴: 7595
威望: 5
浮云: 1566
在线等级:
注册时间: 2006-04-19
最后登陆: 2024-03-27

5come5帮你背单词 [ depart /di'pa:t/ v. 离开,出发,(火车等)开行 ]


vrml~~~~是哪里来的哦    
顶端 Posted: 2008-04-23 20:53 | [1 楼]
summertao



性别: 帅哥 状态: 该用户目前不在线
等级: 栋梁之材
家族: 米兰内洛
发贴: 682
威望: 0
浮云: 1175
在线等级:
注册时间: 2007-09-10
最后登陆: 2008-06-29

5come5帮你背单词 [ baseball /'beisbo:l/ n. 棒球(运动) ]


看不懂啊
顶端 Posted: 2008-04-27 01:56 | [2 楼]
我来我网·5come5 Forum » 程序员之家

Total 0.008967(s) query 5, Time now is:04-28 16:56, Gzip enabled
Powered by PHPWind v5.3, Localized by 5come5 Tech Team, 黔ICP备16009856号