升国旗
/**
*
*/
package lyt;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;
/**
* @author Administrator
*
*/
public class 文本删除指定字符串 extends JFrame{
/**
* @param args
*/
public 文本删除指定字符串()
{
add(new showMouthMove());
// showMouthMove l=new showMouthMove();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
文本删除指定字符串 frame=new 文本删除指定字符串();
frame.setTitle("liangyanting");
frame.setSize(700,800);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
static class showMouthMove extends JPanel{
/**
* @param args
*/
private static ImageIcon china=new ImageIcon("zhongguoguoqi2.gif");
private static Image image=china.getImage();
private int x=100;
private int y=700;
public showMouthMove()
{
Timer timer=new Timer(100,new TimerListener());
timer.start();
}
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
if(y>0)
{
y=y-3;
g.drawImage(image ,100,y,100,100, this);
}
}
class TimerListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
repaint();
}
}
}
}