[java]代码库package day06;
import javax.swing.JFrame;
public class BallFrame {
public BallFrame(){
JFrame frame = new JFrame();
frame.setTitle("弹球游戏");
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
frame.setBounds(100,200,800,600);
frame.setVisible(true);
BallPanel bp = new BallPanel();
frame.add(bp);
frame.setVisible(true);
}
public static void main(String[] args) {
new BallFrame();
}
}
package day06;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import javax.swing.JPanel;
public class BallPanel extends JPanel implements MouseMotionListener {
final static int RIIGHT_DOWN = 0;
final static int LEF