0

I tried to try one of the tutorials, but I can't get the error message under control and don't know how to fix it. VS code gives the following error message:

GlowEffectExample.java is a non-project file, only syntax errors are reported

I have already put the file in another folder but it does not work. Maybe someone can help me.

This is from the following tutorial: https://www.tutorialspoint.com/javafx/glow_effect.html

Thats the code:

import javafx.application.Application; 
import javafx.scene.Group; 
import javafx.scene.Scene; 
import javafx.scene.effect.Glow; 
import javafx.scene.image.Image; 
import javafx.scene.image.ImageView; 
import javafx.stage.Stage; 
         
public class GlowEffectExample extends Application { 
   @Override 
   public void start(Stage stage) {               
      //Creating an image 
      Image image = new Image("http://www.tutorialspoint.com/green/images/logo.png");
   
      //Setting the image view 
      ImageView imageView = new ImageView(image); 
      
      //setting the fit width of the image view 
      imageView.setFitWidth(200);  
      
      //Setting the preserve ratio of the image view 
      imageView.setPreserveRatio(true);       
       
      //Instantiating the Glow class 
      Glow glow = new Glow(); 
      
      //setting level of the glow effect 
      glow.setLevel(0.9); 
      
      //Applying bloom effect to text 
      imageView.setEffect(glow);          
         
      //Creating a Group object  
      Group root = new Group(imageView);   
               
      //Creating a scene object 
      Scene scene = new Scene(root, 600, 300);  
      
      //Setting title to the Stage 
      stage.setTitle("Sample Application"); 
         
      //Adding scene to the stage 
      stage.setScene(scene); 
         
      //Displaying the contents of the stage 
      stage.show();         
   } 
   public static void main(String args[]){ 
      launch(args); 
   } 
}      
  • Do you have a folder for your project source code? – matt Nov 30 '20 at 16:47
  • Follow https://stackoverflow.com/questions/54349894/javafx-11-with-vscode. Once you get that running, replace the `Application` class code with the code you have. – SedJ601 Nov 30 '20 at 16:53
  • @matt I do not think I have such a folder. I just saved the project to a new folder on the desktop without anything in it –  Nov 30 '20 at 16:53
  • 1
    Does this answer your question? [JavaFX-11 with VSCode](https://stackoverflow.com/questions/54349894/javafx-11-with-vscode) – SedJ601 Nov 30 '20 at 16:53

0 Answers0