Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在eclipse中为jyz3d示例导入jfram库_Java_Eclipse_Import_Jframe - Fatal编程技术网

Java 在eclipse中为jyz3d示例导入jfram库

Java 在eclipse中为jyz3d示例导入jfram库,java,eclipse,import,jframe,Java,Eclipse,Import,Jframe,嗨,我有在android中使用jyz3d的示例代码,使用IDEEclipse import org.jzy3d.chart.Chart; import org.jzy3d.colors.Color; import org.jzy3d.colors.ColorMapper; import org.jzy3d.colors.colormaps.ColorMapRainbow; import org.jzy3d.maths.Range; import org.jzy3d.plot3d.builder.

嗨,我有在android中使用jyz3d的示例代码,使用IDEEclipse

import org.jzy3d.chart.Chart;
import org.jzy3d.colors.Color;
import org.jzy3d.colors.ColorMapper;
import org.jzy3d.colors.colormaps.ColorMapRainbow;
import org.jzy3d.maths.Range;
import org.jzy3d.plot3d.builder.Builder;
import org.jzy3d.plot3d.builder.Mapper;
import org.jzy3d.plot3d.builder.concrete.OrthonormalGrid;
import org.jzy3d.plot3d.primitives.Shape;
import javax.swing.JFrame;

public class test {

public static void main(String[] args) {

    JFrame frame = new JFrame();
    Chart chart = getChart();

    frame.add((javax.swing.JComponent) chart.getCanvas());

    frame.setSize(800, 800);
    frame.setLocationRelativeTo(null);
    frame.setTitle("test");
    frame.setVisible(true);
}

public static Chart getChart() {
    // Define a function to plot
    Mapper mapper = new Mapper() {
        public double f(double x, double y) {
            return 10 * Math.sin(x / 10) * Math.cos(y / 20) * x;
        }
    };

    // Define range and precision for the function to plot
    Range range = new Range(-150, 150);
    int steps = 50;

    // Create the object to represent the function over the given range.
    org.jzy3d.plot3d.primitives.Shape surface = (Shape) Builder.buildOrthonormal(new OrthonormalGrid(range, steps, range, steps), mapper);
    surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f)));
    surface.setWireframeDisplayed(true);
    surface.setWireframeColor(Color.BLACK);
    //surface.setFace(new ColorbarFace(surface));
    surface.setFaceDisplayed(true);
    //surface.setFace2dDisplayed(true); // opens a colorbar on the right part of the    
 display

    // Create a chart
    Chart chart = new Chart();
    chart.getScene().getGraph().add(surface);
    return chart;
}
}
问题是导入javax.swing.JFrame时出错;“import javax.swing无法解决”我无法理解这个错误的原因。谢谢你的帮助

问题是导入javax.swing.JFrame时出错


这个问题是由Eclipse的Jdk配置造成的。

您知道如何解决这个问题吗?