Home Segments Top Top Previous Next

973: Mainline

Now, you can use the new layout manager in a variant of the definition shown in Segment 965.

import javax.swing.*; 
import java.awt.event.*; 
import java.util.*; 
public class MovieApplicationWithLayout extends MovieApplication { 
 public MovieApplicationWithLayout () { 
  super(); 
  getContentPane().setLayout(new MovieApplicationLayout()); 
  getContentPane().add("Meter", getMeter());                     
  getContentPane().add("List", new JScrollPane(getJList()));  
  getContentPane().add("Form", getForm());               
  getContentPane().add("Poster", getPoster());                                   
 } 
}