import java.awt.*;
import javax.swing.*;
public class Test extends JFrame {
TestJpanel tp=new TestJpanel();
public Test(){
add(tp);
this.setBounds(20, 20, 960, 700);
this.setDefaultCloseOperation(3);
this.setVisible(true);
this.setResizable(false);
}
public static void main(String[] args) {
Test t=new Test();
}
public class TestJpanel extends JPanel{
Jiangshi js=new Jiangshi();
Wandou wd=new Wandou(js.getY());
public void Paint(Graphics g){
Image img=new ImageIcon("植物大战僵尸\\背景\\background1.jpg").getImage();
g.drawImage(img,0,0,null);
js.dong();
js.zou();
js.xianshi(g);
wd.dong();
wd.zou();
wd.xianshi(g);
repaint();
try{
Thread.sleep(100);
}catch(InterruptedException e){
}
}
}
}