// The copyright of this program is reserved by NL. /* Fourier */ /* */ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Ex061007b extends JApplet implements ActionListener{ boolean flag=false; double h=0.01; JComboBox cb; int num = 1; String cbl[]={"n=1","n=2","n=3","n=4","n=5","n=6","n=7","n=8","n=9","n=10","n=11","n=12","n=13","n=14","n=15","n=16","n=17","n=18","n=19","n=20","n=21","n=22","n=23","n=24","n=25","n=26","n=27","n=28","n=29","n=30","n=31","n=32","n=33","n=34","n=35","n=36","n=37","n=38","n=39","n=40"}; public void init(){ Container cp =getContentPane(); JPanel pl = new JPanel(); pl.setBackground(Color.black); cb = new JComboBox(cbl); cb.setBounds(0,0,60,20); cb.setSelectedIndex(0); cb.addActionListener(this); pl.setLayout(null); pl.add(cb); cp.add(pl); } public void actionPerformed(ActionEvent event){ num = cb.getSelectedIndex()+1; flag=true; repaint(); } public void paint(Graphics g){ super.paint(g); g.setColor(Color.blue); g.drawLine(23,125,337,125); g.drawLine(180,25,180,225); g.drawRect(23,25,314,200); g.setColor(Color.red); g.drawString("-",8,125); g.drawString("",340,125); if(flag==true) for(double x=-Math.PI;x