📄 movestring.java
字号:
// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3)
// Source File Name: MoveString.java
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class MoveString extends Applet
implements Runnable, ActionListener, TextListener
{
public void init()
{
offscreenImage = createImage(getSize().width, getSize().height);
offscreenG = offscreenImage.getGraphics();
pictop = getImage(getCodeBase(), "top.gif");
picbuttom = getImage(getCodeBase(), "buttom.gif");
setLayout(null);
textString = new TextField(name, 21);
textString.addTextListener(this);
add(textString);
textString.setBounds(160, 370, 100, 20);
Button button = new Button("Submit");
button.addActionListener(this);
add(button);
button.setBounds(280, 370, 50, 20);
Button button1 = new Button("Restore");
button1.addActionListener(this);
add(button1);
button1.setBounds(350, 370, 50, 20);
}
public void change()
{
name = textString.getText();
repaint();
}
public void textValueChanged(TextEvent textevent)
{
change();
}
public void actionPerformed(ActionEvent actionevent)
{
request = actionevent.getActionCommand();
if(request == "Submit")
{
change();
return;
}
if(request == "Restore")
{
name = "Wan YanKai";
textString.setText("Wan YanKai");
repaint();
}
}
public void start()
{
if(runner == null)
{
runner = new Thread(this);
runner.start();
}
}
public void stop()
{
if(runner != null)
{
runner.stop();
runner = null;
}
}
public void run()
{
do
{
do
{
angle++;
x = (int)((double)r * Math.sin((6.2831853071795862D * (double)angle) / 360D)) + x0;
y = (int)((double)r * Math.cos((6.2831853071795862D * (double)angle) / 360D)) + y0;
if(angle >= 0 && angle < 90 && angle % 3 == 0)
font--;
else
if(angle >= 90 && angle < 180 && angle % 3 == 0)
font--;
else
if(angle >= 180 && angle < 270 && angle % 3 == 0)
font++;
else
if(angle >= 270 && angle < 360 && angle % 3 == 0)
font++;
d = 2;
if(font < 25)
d = 1;
repaint();
if(font == 66)
font = 65;
try
{
Thread.sleep(25L);
}
catch(InterruptedException _ex) { }
} while(angle != 360);
angle = 0;
} while(true);
}
public void update(Graphics g)
{
paint(g);
}
public void paint(Graphics g)
{
Font font1 = new Font("Symbol", 1, font);
offscreenG.setColor(Color.white);
offscreenG.fillRect(0, 0, 1500, 500);
offscreenG.setColor(Color.black);
offscreenG.setFont(font1);
offscreenG.drawImage(picbuttom, 135, 78, this);
offscreenG.drawString(name, x + d, y - d);
offscreenG.setColor(darkblue);
offscreenG.drawString(name, x, y);
offscreenG.drawImage(pictop, 217, -15, this);
g.drawImage(offscreenImage, 0, 0, this);
}
public MoveString()
{
darkblue = new Color(15, 69, 190);
d = 2;
r = 150;
x = 250;
y = 400;
x0 = 240;
y0 = 200;
font = 65;
name = "Wan YanKai";
}
Color darkblue;
Graphics offscreenG;
Image offscreenImage;
Image pictop;
Image picbuttom;
int d;
int r;
int angle;
int x;
int y;
int x0;
int y0;
int font;
Thread runner;
TextField textString;
String request;
String name;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -