java容器中绘图
java用graphics绘制圆,并利用timer控制它们,每个圆都是一个类,但是当个数超过19个的时候就会出异常,timer是javax.swing.Timer
sun1是主类
ball是类
ball_run是类
异常
Exception in thread "AWT-EventQueue-0" java.lang.ArithmeticException"/by zero
at ball.draw(sun1.java:238);
at ball_run.paintComponent(sun1.java:131)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.painToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source);
下面还有几段 和上面的差不多
at.java.awt.event.IncocationEvent.dispatch(Unknown Source)
........
希望大神帮帮忙 我初学java,不知道这是为什么
[解决办法]