JavaFX Application application instance

  • 2020-05-10 18:05:53
  • OfStack

The following code demonstrates an example of the command line parameter of the JavaFX process. You can refer to 1.


import java.util.List; 
 
 
import javafx.application.Application; 
import javafx.geometry.Insets; 
import javafx.scene.Group; 
import javafx.scene.Scene; 
import javafx.scene.effect.SepiaTone; 
import javafx.scene.image.Image; 
import javafx.scene.image.ImageView; 
import javafx.scene.layout.GridPane; 
import javafx.scene.layout.HBox; 
import javafx.scene.paint.Color; 
import javafx.stage.Stage; 
 
/*  http://www.manongjc.com  */
public class Main extends Application { 
 
 
  public static void main(String[] args) { 
    Application.launch(args); 
  } 
   
  @Override 
  public void start(Stage primaryStage) { 
    primaryStage.setTitle("Title"); 
     
    final Parameters params = getParameters(); 
    final List<String> parameters = params.getRaw(); 
    final String imageUrl = !parameters.isEmpty() ? parameters.get(0) : ""; 
     
    primaryStage.show(); 
  } 
}

Related articles: