EquationFrame - /* / EquationFrame.java Authors: Lewis and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // EquationFrame.java Authors: Lewis and Loftus // // Solution to Programming Project 9.9 // // An application that draws the graph of the equation ax^2 + bx + c, // where the values of a, b, and c are set using three sliders. //******************************************************************** import java.awt.*; import javax.swing.*; import javax.swing.JPanel; import javax.swing.border.LineBorder; import javax.swing.event.*; import java.awt.event.*; i public class EquationFrame extends JFrame { JSlider aSlider; JSlider bSlider; JSlider cSlider; ViewportPanel display; JLabel equationLabel; final String EQUATION_SUBSTRING = "Graph of equation y = "; final int MIN_VALUE = -5; final int MAX_VALUE = 5; final int INIT_VALUE = 0; final int TICK_SPACING = 5; final int MINOR_TICK_SPACING = 1; //----------------------------------------------------------------- // Sets up the equation GUI //----------------------------------------------------------------- public EquationFrame() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().add(getSliderPanel(), BorderLayout.WEST); display = new ViewportPanel(); getContentPane().add(display, BorderLayout.CENTER);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Page1 / 3

EquationFrame - /* / EquationFrame.java Authors: Lewis and...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online