WholePanel

WholePanel - Assignment Name StudentID Lecture Description...

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

View Full Document Right Arrow Icon
// Assignment #: 7 // Name: To be completed // StudentID: To be completed // Lecture: To be completed // Description: it needs to be filled. / import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.util.ArrayList; i public class WholePanel extends JPanel { private Color currentColor; private CanvasPanel canvas; private JPanel leftPanel; private JButton undo; private ArrayList lineList; public WholePanel() { //default color to draw is black currentColor = Color.black; lineList = new ArrayList(); undo = new JButton ("Undo"); leftPanel = new JPanel(); leftPanel.add(undo); canvas = new CanvasPanel(); JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, canvas); c setLayout(new BorderLayout()); add(sp); } //CanvasPanel is the panel where lines will be drawn private class CanvasPanel extends JPanel { //this method draws all lines specified by a user public void paintComponent(Graphics page) { super.paintComponent(page); setBackground(Color.WHITE); //to be filled
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 11/09/2010 for the course CSE 71682 taught by Professor Nakamura during the Spring '10 term at ASU.

Page1 / 2

WholePanel - Assignment Name StudentID Lecture Description...

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