-1

Hi guys I'm new to javafx and keep getting a non accessible error when I try to import SwingFxUtils and BufferedImage. I set up my vm options on eclipse using jdk 18 and I'm still getting the error. Here is my import code

import javafx.embed.swing.SwingFXUtils;
import java.awt.image.BufferedImage;

Here's my vm argument

--module-path "C:\Users\java\Lib\javafx-sdk-18.0.1\lib" --add-modules javafx.controls,javafx.fxml

Your help would be much appreciated thanks

WO5773
  • 1
  • 3

1 Answers1

0

SwingFXUtils and BufferedImage are in different modules: javafx.swing and java.desktop, respectively. You need to add these modules:

--add-modules javafx.controls,javafx.fxml,javafx.swing,java.desktop
James_D
  • 188,960
  • 15
  • 271
  • 305