当前位置: 代码迷 >> Java相关 >> JLabel做的动画,很搞笑的
  详细解决方案

JLabel做的动画,很搞笑的

热度:384   发布时间:2008-04-25 09:25:43.0
JLabel做的动画,很搞笑的
日啊  因为这网站对附件的限制 图片上传不了;如果想看的 把邮箱告诉我 我发文件给他;

程序代码:
package m3434;
import  java.util.*;
import  java.awt.*;
import javax.swing.*;

/**
* @(#)Picture.java
*
*
* @author Heguojin
* @version 1.00 2008/4/10
*/


public class Newpicture5 extends JFrame
{
     
    public Newpicture5(String str)
         {
             super (str);
         }
   
    public static void main (String[] args)
        {
            try{
            
                
            
             int k=0;//属性
//NEW出Newpicture2及设置顶层容器
            Newpicture5 pict= new Newpicture5("见过闷骚的没见过这么闷骚的");
            pict.setSize(2222,2200);
            Container container =pict.getContentPane();
            container.setLayout(new FlowLayout());
            
//new出实现了Icon接口的全部的类并赋给VECTOR
            Vector vector = new Vector(100,1);
            for (int i=0;i<=101;i++ )
                 {
            vector.add(new ImageIcon("D:/591ni/Pic"+String.valueOf(i)+".jpg"   )   );
                 }
            
//new 出9个标签对象并且对其初始化
            JLabel lab1=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
             lab1.setToolTipText("这个SB叫郑新望 他的QQ是318258965:没女朋友,目前处于性饥渴中,请有意请多多联系");
            JLabel  lab2=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            JLabel  lab3=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            JLabel  lab4=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            JLabel  lab5=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            JLabel  lab6=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            JLabel  lab7=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            JLabel  lab8=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            JLabel  lab9=new JLabel((ImageIcon)vector.get(0) ,SwingConstants.LEFT);
            
           
//使图片按秩序播放
             while(true)// 使图片不停的播放
           {
             for(int i=0;i<=101;i++)
            {
            Thread.sleep(220);//设置每副图片的播放的时间间隔
            //取出向量中的对象并交给标签
            lab1.setIcon(  (ImageIcon)vector.get(i)    );
            if(i>54)//设置提示
            lab1.setToolTipText("这个家伙刘勇呢称小胖子 男.QQ:284518567"+"左右铭:世界上根本就没爱情有的只是生殖冲动摆了");
            lab2.setIcon(  (ImageIcon)vector.get(i)    );
            lab3.setIcon(  (ImageIcon)vector.get(i)    );
            lab4.setIcon(  (ImageIcon)vector.get(i)    );
               lab5.setIcon(  (ImageIcon)vector.get(i)    );
               lab6.setIcon(  (ImageIcon)vector.get(i)    );
               lab7.setIcon(  (ImageIcon)vector.get(i)    );
               lab8.setIcon(  (ImageIcon)vector.get(i)    );
               lab9.setIcon(  (ImageIcon)vector.get(i)    );
               
               //把标签添加到内容面板                              
            container.add(lab1);
            container.add(lab2);
            container.add(lab3);
            container.add(lab4);
            container.add(lab5);
            container.add(lab6);
            container.add(lab7);
            container.add(lab8);
            container.add(lab9);
            
            pict.setVisible(true);
            pict.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             if(i==0)//使开始动画放长点时间
                Thread.sleep(5554);
            if(i==101)//使结束动画放长点时间
                 Thread.sleep(4444);
            }
           }
        
           }
           
           
//抓获异常
           catch(ExceptionInInitializerError e)
            {
               System.out.print(e);
               }
               catch(OutOfMemoryError c)
               {
               System.out.print(c);
               }    
                   
           catch(Exception d)
           {
               System.out.print(d);
           }
               
           
        }
   
   
}
搜索更多相关的解决方案: 搞笑  JLabel  动画  邮箱  import  

----------------解决方案--------------------------------------------------------
lxm520910@163.com   谢谢了~!~
----------------解决方案--------------------------------------------------------
xueyin752184@yahoo.com.cn    谢谢
----------------解决方案--------------------------------------------------------
wuhang_520544@sina.com
----------------解决方案--------------------------------------------------------
killerkiller1@163.com
看看是啥
----------------解决方案--------------------------------------------------------
gei wo yige  xuhang13@163.com
----------------解决方案--------------------------------------------------------
我是楼住
不好拖了这么才发
----------------解决方案--------------------------------------------------------
kgdyffjeqq@163.com
  谢了
----------------解决方案--------------------------------------------------------
邮箱jinenghui@sina.com
谢谢!
----------------解决方案--------------------------------------------------------
152906292@qq.com
----------------解决方案--------------------------------------------------------