test2

/**
 * 
 */
package com.webclient;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.BlurType;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 * 一个阴影效果
 * qq:297051898
 * @author luxf
 */
public class StartDropShow extends Application{
	
	public static void main(String[] args) {
		Application.launch(args);
	}

	@Override
	public void start(Stage arg0) throws Exception {
		arg0.setWidth(820);
		arg0.setHeight(620);
		javafx.scene.Group root = new javafx.scene.Group();
		root.setStyle("-fx-background-color:red");
		Scene scene = new Scene(root);
		
		arg0.setScene(scene);
		arg0.initStyle(StageStyle.TRANSPARENT);
		Pane pane = new Pane();
		pane.setLayoutX(10);
		pane.setLayoutY(60);
		pane.setStyle("-fx-background-image:url(\"skin/default/images/bkg.jpg\")");
		pane.setPrefSize(800, 600);
		root.getChildren().add(pane);
		scene.fillProperty().set(Color.TRANSPARENT);
		
		WebView webView = new WebView();
		webView.setPrefSize(800, 559);
		
		WebEngine eng = webView.getEngine();
		eng.load("http://www.163.com");
		pane.getChildren().add(webView);
		
		javafx.scene.effect.DropShadow dropShadow = new javafx.scene.effect.DropShadow();
		dropShadow.setBlurType(BlurType.GAUSSIAN);
		dropShadow.setSpread(0.2);
		root.setEffect(dropShadow);
		
		//jFrame.setVisible(true);
		arg0.show();
		
		
	}

}

你可能感兴趣的:(test2)