求处一个制作java效果的软件.有个软件叫Anfyjava写代码的特效,是专门制作Java网页特效的java写代码的特效,注册费要几百美元java写代码的特效,不注册的话,你的网页发布后,点击Java特效,便会出现意想不到的东西.
放烟花就是这个软件做的
跨年特效代码package love;import java.applet.Applet;import java.awt.Color;import java.awt.Graphics;import java.net.URL;import java.util.Random;/*** 烟花* @author enjoy**/@SuppressWarnings("serial")public class Q extends Applet implements Runnable {public int speed, variability, Max_Number, Max_Energy, Max_Patch,Max_Length, G;public String sound;private int width, height;private Thread thread = null;private BeaClassDemo bcd[];public void init() {int i;this.setSize(1900, 900);width = getSize().width - 1;height = getSize().height - 1;speed = 1;// 烟花绽放java写代码的特效的速度variability = 10;Max_Number = 980;// 可发出烟花java写代码的特效的最大数目Max_Energy = width50;Max_Patch = 90;// 最大java写代码的特效的斑点数Max_Length = 90;// 斑点java写代码的特效的最大距离G = 150;// 向地面弯曲java写代码的特效的力度bcd = new BeaClassDemo[Max_Number];for (i = 0; iMax_Number; i)bcd[i] = new BeaClassDemo(width, height, G);}public void start() {if (thread == null) {thread = new Thread(this);thread.start();}}@SuppressWarnings("deprecation")public void stop() {if (thread != null) {thread.stop();thread = null;}}@SuppressWarnings({ "unused", "static-access" })public void run() {int i;int E = (int) (Math.random() * Max_Energy * 3 / 4)Max_Energy / 41;int P = (int) (Math.random() * Max_Patch * 3 / 4)// 烟花的斑点数Max_Patch / 41;int L = (int) (Math.random() * Max_Length * 3 / 4)// 烟花可发射出的距离Max_Length / 41;long S = (long) (Math.random() * 10000);boolean sleep;Graphics g = getGraphics();URL u = null;while (true) {try {thread.sleep(1000 / speed);} catch (InterruptedException x) {}sleep = true;for (i = 0; iMax_Number; i)sleep = sleepbcd[i].sleep;if (sleepMath.random() * 100variability) {E = (int) (Math.random() * Max_Energy * 3 / 4)Max_Energy / 41;P = (int) (Math.random() * Max_Patch * 3 / 4)Max_Patch / 41;L = (int) (Math.random() * Max_Length * 3 / 4)Max_Length / 41;S = (long) (Math.random() * 10000);}for (i = 0; iMax_Number; i) {if (bcd[i].sleepMath.random() * Max_Number * L1) {bcd[i].init(E, P, L, S);bcd[i].start();}bcd[i].show(g);}}}public void paint(Graphics g) {g.setColor(Color.black);g.fillRect(0, 0, width1, height1);}}class BeaClassDemo {public boolean sleep = true;private int energy, patch, length, width, height, G, Xx, Xy, Ex[], Ey[], x,y, Red, Blue, Green, t;private Random random;public BeaClassDemo(int a, int b, int g) {width = a;height = b;G = g;}public void init(int e, int p, int l, long seed) {int i;energy = e;patch = p;length = l;// 创建一个带种子的随机数生成器random = new Random(seed);Ex = new int[patch];Ey = new int[patch];Red = (int) (random.nextDouble() * 128)128;Blue = (int) (random.nextDouble() * 128)128;Green = (int) (random.nextDouble() * 128)128;Xx = (int) (Math.random() * width / 2)width / 4;Xy = (int) (Math.random() * height / 2)height / 4;for (i = 0; ipatch; i) {Ex[i] = (int) (Math.random() * energy) - energy / 2;Ey[i] = (int) (Math.random() * energy * 7 / 8) - energy / 8;
回答于 2023-02-22
向TA提问
官方服务
官方网站
官方网站
Java编写特效需要学习哪方面的Java知识?主要看java写代码的特效你是想做哪方面的特效java写代码的特效,如果是网页上的特效java写代码的特效,至少你需要懂html、css、js方面的知识 , 如果你是纯java应用的特效,至少你得懂jframe、GUI一类的知识 。如果我的回答对您有帮助 , 请采纳以帮助更多人,如果您还有其它的问题请关注我,私信我java写代码的特效!
求一段javascritp网页特效代码!doctype html
html
head
meta charset="utf-8"
title无标题文档/title
style type="text/css"
#box{width:100px;height:100px;background:red;border-radius:100px;transition:1s;}
.boxLate{
-webkit-transform:translate(200px,300px);
-moz-transform:translate(200px,300px);
-o-transform:translate(200px,300px);
transform:translate(200px,300px);
}
/style
/head
body
input type="button" value="https://www.04ip.com/post/点击移动" id="Btn"
div id="box"/div
script type="text/javascript"
window.onload = function()
{
var oBtn = document.getElementById("Btn");
var oDiv = document.getElementById("box");
oBtn.onclick = function()
{
//alert("f");
oDiv.style.webkitTransform = 'translate(200px,300px)';
oDiv.style.mozTransform = 'translate(200px,300px)';
oDiv.style.oTransform = 'translate(200px,300px)';
oDiv.style.transform = 'translate(200px,300px)';
};
}
/script
/body
/html
页面特效:下星星的代码(JAVA代码)以下的代码就可以,lz自己在*的地方填入星星的图片就可以了
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公告栏特效代码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写代码的特效的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于java如何写代码、java写代码的特效的信息别忘了在本站进行查找喔 。
推荐阅读
- 服务器读博,服务器做bond4
- 32位的oracle数据库安装程序,oracle数据库12c安装
- 小秀直播为什么没音乐,怎样才能打开秀秀直播
- python下面的语句是什么,下面python语句的输出结果
- go语言成都薪资待遇 go语言开发工程师招聘
- flutter调用类中方法,flutter调用第三方sdk
- phpcms管理员权限,phpcms管理员密码忘了
- 打王者什么路由器好用啊,打王者用什么路由器最好
- oracle怎么声明别名 oracle命名