Chapter 6: Inheritance and Abstract Classes Chapter Topics 6.1 ...
Chapter 6: Inheritance and Abstract Classes Chapter Topics 6.1 ...
Chapter 6: Inheritance and Abstract Classes Chapter Topics 6.1 ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CS151 Object-Oriented Design<br />
Dr. Kim<br />
Example: Scene Editor<br />
• Ch6/scene1/SceneEditor.java<br />
/**<br />
A program that allows users to edit a scene composed of items.<br />
*/<br />
public class SceneEditor<br />
{<br />
public static void main(String[] args)<br />
{<br />
JFrame frame = new JFrame();<br />
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br />
final SceneComponent scene = new SceneComponent();<br />
JButton houseButton = new JButton("House");<br />
houseButton.addActionListener(new<br />
ActionListener()<br />
{<br />
17