标题:谁能帮我看看Applet的一个最简单的程序
取消只看楼主
小玲子zhl
Rank: 2
等 级:论坛游民
帖 子:15
专家分:30
注 册:2014-10-23
结帖率:50%
已结贴  问题点数:20 回复次数:0 
谁能帮我看看Applet的一个最简单的程序
import java.applet.Applet;                                 
import java.awt.Button;                                    
import java.awt.Color;                                      
import java.awt.Graphics;                                   
public class TestApp extends Applet{                        
    Button bt;                                             
     void Applet()                                          
    {                                                      
        bt=new Button("确定");                                
        bt.setBackground(Color.BLUE);                       
        add(bt);                                            
    }                                                      
    public void paint(Graphics g)                           
    {                                                      
        g.drawString("调用add方法在容器中添加按钮", 20, 80);            
    }                                                      
    public void init()                                      
    {                                                      
        Applet smp=new Applet();                           
    }                                                      
}                                                           
为什么运行之后没有按钮
搜索更多相关主题的帖子: public import 
2014-12-10 21:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-439817-1-1.html




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

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