import java.awt.*;
import java.applet.*;
//Download by http://www.codesc.net
public class useTrackedImage extends Applet implements Runnable
{
private Image picture;
private MediaTracker tracker;
//初始化
public void init()
{
this.picture = this.getImage(this.getCodeBase(),
//获取图片信息
this.getParameter("imagefile"));
this.tracker = new MediaTracker(this);
//加载图片
this.tracker.addImage(this.picture, 1);
Thread play = new Thread(this);
//启动线程
play.start();
}
//执行线程
public void run()
{
try
{
this.tracker.waitForID(1);
//刷新界面
this.repaint();
}
catch (InterruptedException ie)
{ }
}
//绘制图片
public void paint(Graphics g)
{
if (this.tracker.checkID(1, true))
{
g.drawImage(this.picture, 0, 0, this);
}
else
{
g.drawString("Loading Picture. Please hang on", 25, 50);
}
}
}

weixin_39841856
- 粉丝: 492
- 资源: 1万+
最新资源
- 【9233】基于Springboot+vue的大学生就业需求分析系统.zip
- 【9235】基于Springboot+vue的房屋交易平台的设计与实现.zip
- 【9237】基于Springboot+vue的毕业设计成绩管理系统的设计与实现.zip
- 【9236】基于Springboot+vue的在线课程管理系统的设计与实现.zip
- 【9238】基于Springboot+vue的光影视频.zip
- 【9239】基于Springboot+vue的华府便利店信息管理系统.zip
- C++源码轻量级事实提取技术
- 模型驱动机器人系统工程新方法
- 【9240】基于Springboot+vue的名城小区物业管理系统.zip
- 【9241】基于Springboot+vue的电商应用系统的设计与实现.zip
- Vivado FPGA教程:配置DSP芯片与SRIO通信互联,图像处理滤波及多种通信协议实战指南,Vivado FPGA指南:DSP与FPGA通信互联详解,包括SRIO多路通讯与图像处理滤波技术,vi
- 【9242】基于Springboot+vue的失物招领平台的设计与实现.zip
- 【9243】基于Springboot+vue的小学生身体素质测评管理系统设计与实现.zip
- 【9244】基于Springboot+vue的智慧生活商城系统设计与实现.zip
- 【9245】基于Springboot+vue的科研项目验收管理系统.zip
- 【9246】基于Springboot+vue的老年一站式服务平台.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


