// // FILE: MultiBallWorldFrame.java // AUTHOR: Eugene Wallingford // DATE: 2012/10/11 // COMMENT: a frame with a bunch of moving balls and a button // that causes the balls to move // // MODIFIED: 2012/10/25 -- Eugene Wallingford // CHANGE : modified to use a MultiBallWorldPanel // import java.awt.Frame; import java.awt.Graphics; import java.awt.GridLayout; import java.awt.Panel; public class MultiBallWorldFrame extends Frame { private static final int FrameWidth = 600; private static final int FrameHeight = 400; public MultiBallWorldFrame( int numberOfBalls ) { super(); setSize ( FrameWidth, FrameHeight ); setTitle( "Two Ball Worlds in a Grid" ); setLayout( new GridLayout(2, 1) ); add( new MultiBallWorldPanel( numberOfBalls ) ); add( new MultiBallWorldPanel( numberOfBalls ) ); } public void paint( Graphics g ) { // nothing needed } }