
[英]jasper report showing nothing and getting error NullPointer Error on Netbeans
[英]netBeans error report (details not provided)
当我在下面运行该程序时,netBeans报告“一个或多个项目编译有错误”,但没有提供有关这些错误是什么的指示。 但是,接着说构建成功,并根据需要绘制了Bezier曲线。 有谁知道a)报告存在错误但没有给出任何错误指示的决定背后的想法是什么? b)如何找出错误所在?
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package curve2;
/**
*
* @author User
*/
import java.awt.*;
import java.util.*;
import java.awt.geom.Point2D;
import java.awt.geom.CubicCurve2D;
import org.jfree.ui.ApplicationFrame;
public class Curve2 extends ApplicationFrame {
// Set control points
private int x1 = 200;
private int y1 = 200;
private int ctrlx = 300;
private int ctrly = 300;
private int x2 = 300;
private int y2 = 500;
// Construct frame
public Curve2() {
super("First Bezier Curve");
setSize(600, 600);
//centre();
setVisible(true);
}
public void paint(Graphics g) {
// Set points
Point2D.Double P1 = new Point2D.Double(50, 75); // Start Point
Point2D.Double P2 = new Point2D.Double(150, 75); // End Point
Point2D.Double ctrl1 = new Point2D.Double(80, 25); // Control Point 1
Point2D.Double ctrl2 = new Point2D.Double(160, 100); // Control Point 2
CubicCurve2D.Double cubicCurve; // Cubic curve
cubicCurve = new CubicCurve2D.Double( P1.x, P1.y, ctrl1.x, ctrl1.y, ctrl2.x, ctrl2.y, P2.x, P2.y);
Graphics2D g2 = (Graphics2D)g;
g2.draw(cubicCurve);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.