private static JFrame showDotPlotJFrame ( AFPChain afpChain ) { DotPlotPanel dotplot = new DotPlotPanel ( afpChain ) ; //Create JFrame String title = String . format ( "Dot plot of %s vs. %s" , afpChain . getName1 ( ) , afpChain . getName2 ( ) ) ; // Create window JFrame frame = new JFrame ( title ) ; frame . addWindowListener ( new WindowAdapter ( ) { @ Override public void windowClosing ( WindowEvent e ) { JFrame f = ( JFrame ) e . getSource ( ) ; f . setVisible ( false ) ; f . dispose ( ) ; } } ) ; frame . getContentPane ( ) . add ( dotplot ) ; frame . pack ( ) ; frame . setVisible ( true ) ; return frame ; }
Helper function to create and display a JFrame with a single DotPlotPanel