登录模块加载中...
会员投稿 投稿指南 今天是:
打印本页 | 关闭窗口 | 双击滚屏 您的位置首页>>网页制作学习园地>>JSP教程>>资料及其它文章>>JSP实现打字机效果的程序
JSP实现打字机效果的程序
来源:不详 ‖ 作者:佚名 ‖ 点击: ‖ 时间:11-05-11 15:39:43 ‖ 【 】‖ 我要投稿

import Java.applet.*;
import java.awt.*;
import java.io.*;
import java.net.URL;
import java.util.*;

public class Typewriter4 extends Applet implements Runnable
{

    AudioClip hit, cr, ding ;
    boolean alreadyRun = false,
            soundOn = false,
            loop = false;
    Color bgColor = Color.lightGray,
          textColor = Color.black ;
    Font font ;
    Image offScreen, background ;
    int width, height,
        currentline = 0,
        currentword = 0,
        currentletter = 0,
        depth = 0,
        margin = 0,
        cycles = 0,
        step = 0,
        pause = 0,
        speed = 0,
        update = 0,
        linecount = 0 ;
    long lastread = 0;
    MediaTracker mt ;
    String soundactivation, text, textfile, target ;
    Thread woohoo = null;
    URL hotlink = null;
    Vector lines = null;

    public Typewriter4()
    {

        alreadyRun = false;
        soundOn = false;
        loop = true;
        soundactivation = "enter";

    }

    public void buildLines()
    {

        lines = new Vector();
        FontMetrics fontmetrics =
                offScreen.getGraphics().getFontMetrics();
        StringTokenizer strTok = new StringTokenizer(text, "\n") ;
        while (strTok.hasMoreTokens())
        {

            StringTokenizer strTok1 =
                       new StringTokenizer(strTok.nextToken());
            int wordcount = strTok1.countTokens();
            String[] words = new String[wordcount];
            for(int i = 0; i < wordcount; i++)
  

|<< << < 1 2 3 4 5 6 7 8 9 10 > >> >>|
加入收藏:  加入收藏夹  | 发送给好友:  发送给好友
责任编辑:admin
  • 上一篇:Java中用for循环取Map
  • 下一篇:无
  • 相关文章列表
    请文明参与讨论,禁止漫骂攻击。  
    网友评论