Lab #02a 4 Diagram Exercise
Lab #02a 4 Diagram Exercise Lab #02a 4 Diagram Exercise
ES --- MED 43 University Bremerhaven --- IAE } } // Make it visible: // Create a frame. JFrame frame = new JFrame("Cosine Samples"); // add the chart to the frame: frame.getContentPane().add(chart); frame.setSize(400,300); // Enable the termination button [cross on the upper right edge]: frame.addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent e){ System.exit(0); } } ); frame.setVisible(true); } static final int N_POINTS = 16; " This result should look as follows: Figure 1.45: JChartTst output
ES --- MED 44 University Bremerhaven --- IAE " Modify the source code to display cosine samples of one period. This result should be as follows: Figure 1.46: Modified JChartTst output with cosine samples
ES --- MED 43<br />
University Bremerhaven --- IAE<br />
}<br />
}<br />
// Make it visible:<br />
// Create a frame.<br />
JFrame frame = new JFrame("Cosine Samples");<br />
// add the chart to the frame:<br />
frame.getContentPane().add(chart);<br />
frame.setSize(400,300);<br />
// Enable the termination button [cross on the upper right edge]:<br />
frame.addWindowListener(<br />
new WindowAdapter() {<br />
@Override<br />
public void windowClosing(WindowEvent e){<br />
System.exit(0);<br />
}<br />
}<br />
);<br />
frame.setVisible(true);<br />
}<br />
static final int N_POINTS = 16;<br />
" This result should look as follows:<br />
Figure 1.45: JChartTst output