求java公告栏特效代码import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class Test{
private JFrame frame;
private String scrolledText;
private String str ="滚动文字 Demo";
public static void main(String args[]) {
try{
Test window = new Test();
window.frame.setVisible(true);
}
catch(Exception e){
e.printStackTrace();
}
}
public Test(){
initialize();
}
private void initialize(){
frame.setBounds(100, 100, 500, 375);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JPanel panel = new JPanel();
panel.setBackground(Color.WHITE);
panel.setLayout(new BorderLayout());
frame.getContentPane().add(panel, BorderLayout.NORTH);
final JLabel label = new JLabel();
label.setText("New JLabel");
panel.add(label);
label_scrolledText(label);
frame.addComponentListener(
new ComponentAdapter(){
public void componentResized(ComponentEvent arg0){
label_scrolledText(label);
}
});
}
public void label_scrolledText(JLabel label) {
this.scrolledText = this.str;
label.setText(scrolledText);
FontMetrics metrics = label.getFontMetrics(label.getFont());
int textW = metrics.stringWidth(label.getText());
Dimension frameSize = frame.getSize();
for (int i = 1; i = (frameSize.width - textW) / 3 - 3; i++)
scrolledText += " ";
label.setText(scrolledText);
Thread thread = new Thread(new TextChanger(label));
thread.start();
}
}
java.lang.NullPointerException
at Test.initialize(Test.java:26)
at Test.init(Test.java:23)
at Test.main(Test.java:16)
页面特效:下星星的代码(JAVA代码)以下java首页超酷特效代码的代码就可以java首页超酷特效代码,lz自己在*java首页超酷特效代码的地方填入星星java首页超酷特效代码的图片就可以java首页超酷特效代码了
body bgcolor=#ee3300
style
.drop { position: absolute; width: 3;filter: flipV(), flipH(); font-size: 40; color: #ffffff }
/style
script language="javascript"
snow = false;// false-rain;true-snow
snowsym = " * "are the symbols for each
rainsym = " * "can put images here.
howmany = 20many drops/snowflakes?
/**************Do not need to change anything below***********/
if(snow){sym = snowsym; speed=1; angle=10; drops=howmany}
else{sym = rainsym; speed=30; drops=howmany; angle=6}
movex = -speed/angle; movey = speed; count = 0;
function moverain(){
for(move = 0; movedrops; move++){
xx[move]+=movex;yy[move]+=mv[move];
hmm = Math.round(Math.random()*1);
if(xx[move]0){xx[move] = maxx+10;}
if(yy[move]maxy){yy[move] = 10;}
drop[move].left = xx[move]
drop[move].top = yy[move]+document.body.scrollTop;
}setTimeout('moverain()','1')}
/script
script language="javascript"
if (document.all){
drop = new Array(); xx = new Array(); yy = new Array(); mv = new Array()
ly = "document.all[\'"; st = "\'].style"
for(make = 0; makedrops; make++){
document.write('div id="drop'+make+'" class=drop'+sym+'/div');
drop[make] = eval(ly+'drop'+make+st);
maxx = document.body.clientWidth-40
maxy = document.body.clientHeight-40
xx[make] = Math.random()*maxx;
yy[make] = -100-Math.random()*maxy;
drop[make].left = xx[make]
drop[make].top = yy[make]
mv[make] = (Math.random()*5)+speed/16;
drop[make].fontSize = (Math.random()*10)+20;
if(snow){col = 'white'}else{col = 'white'}
drop[make].color = col;
}
window.onload=moverain
}
/script
/body
急求一个网页特效代码用这个吧 可以全屏拖动java首页超酷特效代码的 支持FLASH引用
script id=clientEventHandlersJS language=JScript
推荐阅读
- 钉钉为什么进不了公司直播,钉钉为什么进不去直播
- 鸿蒙桌面图片素材白色背景,鸿蒙桌面图片素材红色
- 非对称冒险手机游戏破解版,非对称游戏排行
- python函数调用位置 如何在python中调用函数
- 电商面对疫情如何应对客户,疫情之下的电商还可以采取哪些营销策略?
- 国外服务器域名被国内封禁,国外域名会不会被国内封
- 关于postgresql数据类型一览的信息
- vb.net基本数剧类型 vb基本数据类型
- cad2007未安装net4.5,cad2010未安装net35