⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 threadappletdemo1.java

📁 JAVA程序设计课程中各章节的程序实例。
💻 JAVA
字号:
/**
*A simple thread program with applet 
*how to clear the screen???
*2004.12.23. xhcprince
*/

import java.applet.*;
import java.awt.*;

public class threadAppletDemo1 extends Applet 
{
	char c = 'a';
	Font f;
	
	public void init()
	{
		f = new Font("TimesNewRoman",Font.BOLD,18);
		setFont(f);
	}
	
	public void paint(Graphics g)
	{
		while(true)
		{		
			if(c >= 'z')
				c = 'a';
				
			++c;
			g.drawString(" " + c,11,24);
	
			try
			{
				Thread.sleep(1000);
			}

			catch(InterruptedException e)
			{
				System.out.println(e.getMessage());
			}
		}
	}
}
/*
<applet code = "threadAppletDemo1.class" width = 600 height =  160>
</applet>
*/


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -