jafafx-能编译却无法执行

李馥东 发布于 2015/12/19 21:56
阅读 132
收藏 0

大家好,我刚接触javafx,安装了netbeans7.4,jdk是1.7,我写第一个javafx测试,代码如下:

import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.effect.BlendMode;
import javafx.scene.effect.BoxBlur;
import javafx.scene.paint.Color;
import javafx.scene.paint.CycleMethod;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.StrokeType;
import javafx.stage.Stage;
import javafx.util.Duration;
import static java.lang.Math.random;
public class ColorfulCircles extends Application { 
        @Override  
        public void start(Stage primaryStage) {  
            Group root = new Group();  
            Scene scene = new Scene(root, 800, 600, Color.BLACK);  
            primaryStage.setScene(scene); 
            primaryStage.show();  
        }       
     public static void main(String[] args) {  
            launch(args);  
        }  
    } 
但netbeans总是能编译,但无法运行,总是提示:

ant -f "D:\\netbeantJAVA\\ ColorfulCircles" -Djavac.includes=ColorfulCircles.java -Drun.class=ColorfulCircles -Dnb.internal.action.name=run.single run-single
init:
Deleting: D:\netbeantJAVA\ ColorfulCircles\build\built-jar.properties
deps-jar:
Updating property file: D:\netbeantJAVA\ ColorfulCircles\build\built-jar.properties
Compiling 1 source file to D:\netbeantJAVA\ ColorfulCircles\build\classes
compile-single:
run-single:
错误: 找不到或无法加载主类 ColorfulCircles
Java Result: 1

真心求指教,问题折磨我好久了,查了很多资料,找不到解决方法

加载中
返回顶部
顶部