Home Segments Top Top Previous Next

1089: Mainline

You can run the program shown in Segment 1088 using the following test program:

import javax.swing.*; 
import java.awt.event.*; 
public class TestFrame extends JFrame { 
 public static void main (String argv []) { 
  new TestFrame("Layout Window"); 
 } 
 TestPanel testPanel = new TestPanel();         
 public TestFrame(String title) { 
  super(title); 
  getContentPane().add("Center", testPanel);         
  setSize(260, 150); 
  addWindowListener(new LocalWindowListener()); 
  show(); 
 } 
// Definition of LocalWindowListener as in Segment 702 
} 

When you run the test program, you see the following display: