I've been trying to apply blur to Vbox in my scene but only blur Vbox so image behind it seems blurry, but when I do this whole Vbox along with its children gets blurred but I don't want this as the components on top of Vbox should be visible to User
Whole Vbox Blurry:
I want the VBox to only get blurred on its own, and the TextFields on the Vbox along with Lables should stay visible
My code:
package UI.Controllers;
import javafx.embed.swing.SwingFXUtils;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Rectangle2D;
import javafx.scene.effect.BoxBlur;
import javafx.scene.effect.GaussianBlur;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage;
import javafx.scene.layout.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.net.URL;
import java.nio.Buffer;
import java.util.ResourceBundle;
public class LoginTemp implements Initializable {
@FXML
private VBox loginBox;
public void applyBlur(){
Image image = new Image("bg2.jepg");
ImageView imageView = new ImageView(image);
BoxBlur blur = new BoxBlur(3,3,3);
loginBox.setEffect(blur);
BackgroundImage bgImage = new BackgroundImage(imageView.getImage(),BackgroundRepeat.REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT,
BackgroundSize.DEFAULT);
loginBox.setBackground(new Background(bgImage));
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
applyBlur();
}
}