From e3a1269de1103bdf6bd6badfe7054c6ca63811b9 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 16 Oct 2017 22:31:21 +0200 Subject: [PATCH] Java 9 makes internal classes inaccessible, so setting the page background is no longer supported: package com.sun.webkit is declared in module javafx.web, which does not export it --- .../net/filebot/ui/GettingStartedStage.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/net/filebot/ui/GettingStartedStage.java b/source/net/filebot/ui/GettingStartedStage.java index 4a55cda5..45fa43a6 100644 --- a/source/net/filebot/ui/GettingStartedStage.java +++ b/source/net/filebot/ui/GettingStartedStage.java @@ -1,14 +1,11 @@ package net.filebot.ui; -import static net.filebot.Logging.*; import static net.filebot.Settings.*; import static net.filebot.util.ui.SwingUI.*; -import java.lang.reflect.Field; import java.net.URL; import java.util.Locale; import java.util.Optional; -import java.util.logging.Level; import javafx.animation.Interpolator; import javafx.animation.KeyFrame; @@ -115,15 +112,18 @@ public class GettingStartedStage { } protected void setBackground(WebEngine engine, int color) { - try { - // use reflection to retrieve the WebEngine's private 'page' field - Field f = engine.getClass().getDeclaredField("page"); - f.setAccessible(true); - com.sun.webkit.WebPage page = (com.sun.webkit.WebPage) f.get(engine); - page.setBackgroundColor(color); - } catch (Exception e) { - debug.log(Level.WARNING, "Failed to set background", e); - } + /* + * Java 9 makes internal classes inaccessible, so setting the page background is no longer supported: package com.sun.webkit is declared in module javafx.web, which does not export it + */ +// try { +// // use reflection to retrieve the WebEngine's private 'page' field +// Field f = engine.getClass().getDeclaredField("page"); +// f.setAccessible(true); +// com.sun.webkit.WebPage page = (com.sun.webkit.WebPage) f.get(engine); +// page.setBackgroundColor(color); +// } catch (Exception e) { +// debug.log(Level.WARNING, "Failed to set background", e); +// } } protected WebEngine onPopup(WebView webview) {