TrafficControlPanel - { setLayout(new BorderLayout());...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Author: Lewis/Loftus // // Solution to Programming Project 7.8 //******************************************************************** / import javax.swing.*; import java.awt.*; import java.awt.event.*; i public class TrafficControlPanel extends JPanel { TrafficLightPanel light; public TrafficControlPanel()
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { setLayout(new BorderLayout()); light = new TrafficLightPanel(); add(light, BorderLayout.CENTER); JButton change = new JButton("Change Light"); change.addActionListener(new ChangeListener()); add(change, BorderLayout.SOUTH); } class ChangeListener implements ActionListener { public void actionPerformed(ActionEvent event) { light.change(); } } }...
View Full 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.

Ask a homework question - tutors are online