Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
bouncing-ball/MovingBallApp.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25 lines (24 sloc)
824 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Lab 2 - MovingBallApp | |
* Displays a window with a ball which bounces around the window. | |
*/ | |
import java.awt.*; | |
import javax.swing.*; | |
public class MovingBallApp extends javax.swing.JFrame { | |
private BallPanel _theBallPanel; | |
public MovingBallApp (String title) { | |
// Instantiate the window with the specified title | |
super(title); | |
// Set the size of the window and the default close operaton | |
this.setSize(600, 450); | |
this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); | |
// Instantiate the JPanel and add to the window | |
_theBallPanel = new BallPanel(); | |
this.add(_theBallPanel); | |
// Make the window visible | |
this.setVisible(true); | |
} | |
public static void main (String [ ] args) { | |
MovingBallApp app = new MovingBallApp ("CSE 2102 - Lab 2"); | |
} | |
} |