| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 634 人关注过本帖
标题:applet在网页中显示的问题
只看楼主 加入收藏
yimaoqian198
Rank: 4
等 级:业余侠客
帖 子:108
专家分:287
注 册:2010-5-10
结帖率:100%
收藏
已结贴  问题点数:5 回复次数:2 
applet在网页中显示的问题
程序代码:
import java.awt.*;
import java.applet.Applet;
import javax.swing.JApplet;

public class MoonApplet extends Applet
{
    public void paint(Graphics g)
    {
        g.setColor(Color.red);
        g.drawString("The Moon", 100,20);
        int x=0,y=0;
        y=this.getHeight()/4;
        x=this.getWidth()/4;
        int diameter=Math.min(this.getWidth()/2, this.getHeight()/2);
        g.setColor(Color.yellow);
        g.fillOval(x, y, diameter, diameter);
        g.setColor(this.getBackground());
        g.fillOval(x-20, y-20,diameter, diameter);
       
    }
    

}


<html>
<applet code="MoonApplet.class" height=100 width=300>
</applet>
<html>
可是在网页中显示的只是一个小叉,这是怎么回事
 
搜索更多相关主题的帖子: applet 网页 
2010-06-01 16:12
ljwei
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:46
专家分:192
注 册:2009-9-18
收藏
得分:3 
路过 帮顶
2010-06-01 23:32
yimaoqian198
Rank: 4
等 级:业余侠客
帖 子:108
专家分:287
注 册:2010-5-10
收藏
得分:0 
我重做了系统好了
2010-06-02 09:35
快速回复:applet在网页中显示的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017704 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved