当前位置: 技术问答>java相关
<<<<<<<<<<<<<<<<<<编译通过,运行出错>>>>>>>>>>>>>>>>>>>>>
来源: 互联网 发布时间:2015-10-22
本文导语: import javax.swing.*; import javax.swing.event.*; import java.awt.*; class SineDraw extends JPanel { static final int SCALEFACTOR = 200; int cycles; int points; double[] sines; int[] pts; SineDraw(){setCycles(5);} public void setCycles(int newCycles) { cycl...
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
class SineDraw extends JPanel
{
static final int SCALEFACTOR = 200;
int cycles;
int points;
double[] sines;
int[] pts;
SineDraw(){setCycles(5);}
public void setCycles(int newCycles)
{
cycles = newCycles;
points = SCALEFACTOR * cycles * 2;
sines = new double[points];
pts = new int[points];
for(int i=0 ; i
import javax.swing.event.*;
import java.awt.*;
class SineDraw extends JPanel
{
static final int SCALEFACTOR = 200;
int cycles;
int points;
double[] sines;
int[] pts;
SineDraw(){setCycles(5);}
public void setCycles(int newCycles)
{
cycles = newCycles;
points = SCALEFACTOR * cycles * 2;
sines = new double[points];
pts = new int[points];
for(int i=0 ; i