
12.18 Exercises,Problems,and Projects 929
EXERCISES,PROBLEMS, AND PROJECTS
{
// some code here
private class MyHandler implements ItemListener
{
public void itemStateChanged( ActionEvent e )
{}
}
}
12.18.5 Debugging Area—Using Messages from the Java Compiler and Java JVM
46. You coded the following in the file MyGame.java:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MyGame extends JFrame
{
private Container c;
private JLabel l;
public MyGame()
{
super( ”My Game“ );
c = getContentPane();
c.setLayout( new FlowLayout());
c.add( l ); // Line 15
}
public static void main( String []args )
{
MyGame mg = new MyGame(); // Line 20
}
}
The code c