
/**
 * Example Application Incorporating Progeny Anywhere Java Bean
 */
import javax.swing.*;
import java.awt.*;
import com.objex.panywhere.*; 


/**
 *
 * Example application 
 */
public class ExampleApp extends JFrame  {
	private ProgenyAnywhere m_anywhere;    
    
    public ExampleApp() {                                                      
        super("Progeny Anywhere Example Application");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        getContentPane().setLayout(new BorderLayout());            
        
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());            
            //create a new instance of the Pedigree Bean
			m_anywhere = new ProgenyAnywhere();        
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
        
        //Add the new Pedigree to a JScrollPane object 
		JScrollPane jsp = new JScrollPane(m_anywhere.m_canvas, 
                                          JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, 
                                          JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        
        //Add the ScrollPane to the content Pane of the Example App container.
        getContentPane().add(jsp, BorderLayout.CENTER);         
        
        //Set the size of the Container to fit to the size of the computer screen
        setSize(Toolkit.getDefaultToolkit().getScreenSize().width  - 25, 
                Toolkit.getDefaultToolkit().getScreenSize().height - 50);      
        
        setVisible(true);         
    }
    
    
    //Application Entry Point
    public static void main(String[] args) throws HeadlessException {       
        new ExampleApp();        
    }
} 

