java 多线程 滚动字幕
发布网友
发布时间:2022-07-16 00:28
我来回答
共1个回答
热心网友
时间:2024-05-21 05:37
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class MyApplet extends Applet implements Runnable {
static{
new Thread(new MyApplet()).start();
}
int i =20;
@Override
public void paint(Graphics g) {
Color c= g.getColor();
g.drawRect(20, 20, 220, 30);
g.setColor(Color.BLUE);
g.fillRect(20, 20, 220, 30);
g.setColor(Color.BLACK);
if(i>220)i=20;
g.drawString("小子,你好!QQ:1442560143", i, 30);
i=i+2;
} @Override
public void run() {
try{
while(true){
repaint();
Thread.sleep(1000);
}
}catch(Exception e){
System.out.println("出错了,小子");
}
}}
热心网友
时间:2024-05-21 05:37
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class MyApplet extends Applet implements Runnable {
static{
new Thread(new MyApplet()).start();
}
int i =20;
@Override
public void paint(Graphics g) {
Color c= g.getColor();
g.drawRect(20, 20, 220, 30);
g.setColor(Color.BLUE);
g.fillRect(20, 20, 220, 30);
g.setColor(Color.BLACK);
if(i>220)i=20;
g.drawString("小子,你好!QQ:1442560143", i, 30);
i=i+2;
} @Override
public void run() {
try{
while(true){
repaint();
Thread.sleep(1000);
}
}catch(Exception e){
System.out.println("出错了,小子");
}
}}
热心网友
时间:2024-05-21 05:37
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class MyApplet extends Applet implements Runnable {
static{
new Thread(new MyApplet()).start();
}
int i =20;
@Override
public void paint(Graphics g) {
Color c= g.getColor();
g.drawRect(20, 20, 220, 30);
g.setColor(Color.BLUE);
g.fillRect(20, 20, 220, 30);
g.setColor(Color.BLACK);
if(i>220)i=20;
g.drawString("小子,你好!QQ:1442560143", i, 30);
i=i+2;
} @Override
public void run() {
try{
while(true){
repaint();
Thread.sleep(1000);
}
}catch(Exception e){
System.out.println("出错了,小子");
}
}}
热心网友
时间:2024-05-21 05:37
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class MyApplet extends Applet implements Runnable {
static{
new Thread(new MyApplet()).start();
}
int i =20;
@Override
public void paint(Graphics g) {
Color c= g.getColor();
g.drawRect(20, 20, 220, 30);
g.setColor(Color.BLUE);
g.fillRect(20, 20, 220, 30);
g.setColor(Color.BLACK);
if(i>220)i=20;
g.drawString("小子,你好!QQ:1442560143", i, 30);
i=i+2;
} @Override
public void run() {
try{
while(true){
repaint();
Thread.sleep(1000);
}
}catch(Exception e){
System.out.println("出错了,小子");
}
}}