对了还有二句没写:        
        prevLabel = new Label("<\u2014\u2014"); //\u2014 为字符-
        nextLabel = new Label("\u2014\u2014>");

解决方案 »

  1.   

    <html><body>
    <applet code=ChartLine.class name="ChartLine" width=200 height=170>
    <param name=rows value="6">
    <param name=columns value="10"> 
    <param name=hscale value=16>
    <param name=vscale value=16>
    <param name=hstart value=6>
    <param name=vstart value=32> 
    </applet>
    </body>
    </html>     下面取上面的参数的部分程序
            s1 = getParameter("rows");
            if(s1 != null && !s1.equals(""))
            {
                rows = (new Integer(s1)).intValue();
            } else
            {
                rows = 5;
            }
            s1 = getParameter("columns");
            if(s1 != null && !s1.equals(""))
            {
                cols = (new Integer(s1)).intValue();
            } else
            {
                cols = 6;
            }
            s1 = getParameter("hstart");
            if(s1 != null && !s1.equals(""))
            {
                hstart = (new Integer(s1)).intValue();
            } else
            {
                hstart = 10;
            }
            s1 = getParameter("vstart");
            if(s1 != null && !s1.equals(""))
            {
                vstart = (new Integer(s1)).intValue();
            } else
            {
                vstart = 40;        }
            s1 = getParameter("hscale");
            if(s1 != null && !s1.equals(""))
            {
                hscale = (new Integer(s1)).intValue();
            } else
            {
                hscale = 30;
            }
            s1 = getParameter("vscale");
            if(s1 != null && !s1.equals(""))
            {
                vscale = (new Integer(s1)).intValue();
            } else
            {
                vscale = 30;
            }
            prevLabel = new Label("<\u2014\u2014"); //\u2014 为字符-
            nextLabel = new Label("\u2014\u2014>");        int j = (cols * hscale - 120) / 2;    //为什么要减去120  ???
            prevLabel.setBounds(hstart + j, vstart + rows * vscale + 16, 50, 18);    //得到的是什么??
            nextLabel.setBounds(hstart + j + 70, vstart + rows * vscale + 16, 50, 18);
        对于最后三句话看不懂。望高手给我指点。非常感谢!
      

  2.   

    j是用来定位的,每次位置不一样
    后两句设置了这两个Label的位置。
      

  3.   

    那为什么要减120呀。可以减别的数。
     能否说说setBounds()函数的用法?刚学java,望高手不要笑我的问题我太菜!我真的不懂。
      

  4.   

    晕,你这个程序是干吗的哦?你这个问题实在无聊,这是在设置label的边界(bounds),就是lable,到底从什么坐标开始,长多少,宽多少。至于为什么减120,那是因为写这个程序的人想减120,当然如果不减120,肯定得不到效果。这个问题好比房子为什么要修3层,不修5层,人家本来就是想修3层而已。
    prevLabel = new Label("<\u2014\u2014"); //\u2014 为字符
    nextLabel = new Label("\u2014\u2014>");
    这是在设置label上面的文本,为了避免中文化问题(也许是日文和韩文),特意写的是UNICODE的编码。
      

  5.   

    这些是用来设置边界的,没有什么别的意思,不要惊慌失乱。http://xieweibbs.topcities.com