2012-04-03 19 views
0

私はjavafxを学んでいます。Javafx 2.0でPath()クラスをインスタンス化できません

私はパスを作るしようとしているが、私は()クラスパスをインスタンス化するとき、私は、次のメッセージが表示されます。「java.nio.file.Pathは抽象的であり、インスタンス化できない」

package mapas; 

import javafx.application.Application; 
import javafx.scene.Group; 
import javafx.scene.Scene; 
import javafx.scene.effect.BoxBlur; 
import javafx.scene.paint.Color; 
import javafx.scene.shape.Circle; 
import javafx.scene.shape.StrokeType; 
import javafx.stage.Stage; 
import java.nio.file.Path; 
import javax.sound.midi.Patch; 

public class Mapas extends Application { 

    public static void main(String[] args) { 
     launch(args); 
    } 

    @Override 
    public void start(Stage primaryStage) { 
     Group root = new Group(); 
     Group circles = new Group(); 
    Scene scene = new Scene(root, 800, 600, Color.BLACK); 
     primaryStage.setScene(scene); 
    circles.setEffect(new BoxBlur(10, 10, 3)); 
    primaryStage.show(); 


    for(int i = 0; i < 30; i++){ 
     Circle circle = new Circle(150, Color.web("white", 0.05)); 
     circle.setStrokeType(StrokeType.OUTSIDE); 
     circle.setStroke(Color.web("white", 0.16)); 
     circle.setStrokeWidth(4); 
     circles.getChildren().add(circle); 
    } 
    root.getChildren().add(circles); 

    Path path = new Path(); // <-- error 
    } 
} 

どういうところが間違っていますか?

答えて

3

javafx.scene.shape.Pathとは対照的に、import java.nio.file.Pathとしますか?

+0

問題が解決しました。 – matheusvmbruno

関連する問題