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
import java.awt.*; | |
import java.awt.event.*; | |
import java.util.ArrayList; | |
import javax.swing.*; | |
public class BouncingBall extends JFrame { | |
public BouncingBall() { | |
add(new BallControl()); | |
} |
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
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class HTreeTextField extends JFrame { | |
private JTextField tf = new JTextField("0", 5); | |
private HTree htree = new HTree(); | |
public HTreeTextField() { |
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
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class KochSnowflake extends JFrame { | |
private KochFrame koch = new KochFrame(); | |
private JTextField tf = new JTextField("0", 5); | |
public KochSnowflake() { | |
JPanel panel = new JPanel(); |
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
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class Test { | |
public static void main(String[] args){ | |
JFrame f = new SierpinskiTriangle(); | |
f.setSize(300, 300); | |
f.setLocationRelativeTo(null); |
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
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class PlayConnectFourWithComputer extends JFrame { | |
private Cell[][] cells = new Cell[6][7]; | |
private char nextDisc = 'R'; | |
private int[][] result; | |
private Timer timer = new Timer(100, new FlashingCells()); | |
private JButton startOver = new JButton("Start Over"); |
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
import java.awt.*; | |
import java.awt.event.*; | |
import java.io.IOException; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.Scanner; | |
import javax.swing.*; | |
public class URLTest extends JFrame { |
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
import java.awt.event.*; | |
import javax.swing.*; | |
import java.awt.BorderLayout; | |
import java.awt.Color; | |
import java.awt.Dimension; | |
import java.awt.GridLayout; | |
import java.util.Calendar; | |
import java.util.GregorianCalendar; | |
import javax.swing.border.Border; | |
import javax.swing.border.LineBorder; |
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
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
import javax.swing.border.EmptyBorder; | |
public class FontTest extends JFrame { | |
String font = "Dialog"; | |
int size = 12; | |
int fontStyleBold = 0; |
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
import java.awt.*; | |
import javax.swing.*; | |
public class Histogram extends JPanel { | |
// Count the occurrences of 26 letters | |
private int[] count; | |
/** | |
* Set the count and display histogram |
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
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class BallOnCurveFrame extends JFrame { | |
private BallOnCurvePanel curvePanel = new BallOnCurvePanel(); | |
BallOnCurveFrame() { | |
curvePanel.setBackground(Color.black); |
NewerOlder