I am using a sandboxed applet in a browser.
Inside it there is only one WebView with some simple HTML.
When i hold and drag the middle mouse-button diagonally (sideways + up/down) then the view is moved, but not painted correctly and i get a kind of smear effect. Some parts update correctly (i guess those near the animated gif).
When i scroll using the mousewheel the damaged areas repair themselves once they scroll out and into the view again. But the parts that stay visible remain damaged.
I don't know if this only applies to sandboxed applets, i believe not.
Sample applet code:
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker.State;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javax.swing.JPanel;
public class JavaFXTest extends Applet
{
private static final long serialVersionUID = -7110935176335971839L;
public JavaFXTest()
{
super();
addMouseWheelListener(new MouseWheelListener()
{
public void mouseWheelMoved(MouseWheelEvent e)
{
e.consume(); // prevent MouseWheel Events to bubble up to the web-page.
}
});
}
@Override
public void init()
{
setLayout(new BorderLayout());
HTMLPanel htmlPanel = new HTMLPanel();
add(BorderLayout.CENTER, htmlPanel);
htmlPanel.setHTMLContent("<html>\r\n" +
" <head>\r\n" +
" <base href=\"http://local.testserver.knuddels.de:2710/\" />\r\n" +
"\r\n" +
" <script type='text/javascript' src='/pics/js/firebug-lite/firebug-lite.js'></script>\r\n" +
" <!--\r\n" +
" <script type='text/javascript' src='http://www.getfirebug.com/firebug-lite.js#startOpened'></script>\r\n" +
" /htmldebug\r\n" +
" -->\r\n" +
" <style type=\"text/css\">\r\n" +
" * { background-color: rgb(0,0,0,0); }\r\n" +
" /*\r\n" +
" * { background-color: rgb(0,128,0,0); }\r\n" +
" * { background-color: rgba(0,128,0,0); }\r\n" +
" */\r\n" +
" .gray { color: #999; }\r\n" +
" .green { color: #080; }\r\n" +
" .red { color: #800; }\r\n" +
" img { max-height: 100px; }\r\n" +
" div { margin-top: 8px; background-color: skyblue; }\r\n" +
" div { background-color: rgba(50,50,255,0.1); }\r\n" +
" html { background-color: rgba(50,50,255,0.1); }\r\n" +
" body { background-color: rgba(50,50,255,0.1); }\r\n" +
" </style>\r\n" +
" </head>\r\n" +
" <body>\r\n" +
" <base href=\"http://local.testserver.knuddels.de:2710/\" />\r\n" +
" <table border=\"1\">\r\n" +
" <tr>\r\n" +
" <td><img src='/pics/auction/auctionButton.png' /></td>\r\n" +
" <td><base> + /pics/auction/auctionButton.png\r\n" +
" <div class=\"green\">(lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://local.testserver.knuddels.de:2710/pics/auction/auctionButton.png' /></td>\r\n" +
" <td>http://local.testserver.knuddels.de:2710/pics/auction/auctionButton.png\r\n" +
" <div class=\"green\">(lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='/pics/sm_abo_001A_biglaugh.gif' /></td>\r\n" +
" <td><base> + /pics/sm_abo_001A_biglaugh.gif\r\n" +
" <div class=\"green\">(animiert, lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='/pics/fotos/knuddels.de?n=Plex&noPic=0&cnt=0&idx=plex-pro0m0p&.de&.jpg' /></td>\r\n" +
" <td><base> + /pics/fotos/knuddels.de?n=Plex&noPic=0&cnt=0&idx=plex-pro0m0p&.de&.jpg\r\n" +
" <div class=\"green\">(lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://snaps.knuddels.de/knuddels.de/jam/james-pro0msq0p.img' /></td>\r\n" +
" <td>http://snaps.knuddels.de/knuddels.de/jam/james-pro0msq0p.img\r\n" +
" <div class=\"green\">(MIT crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://www.meinebasis.de/images/BlobboBig.png' /></td>\r\n" +
" <td>http://www.meinebasis.de/images/BlobboBig.png\r\n" +
" <div class=\"green\">(MIT crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='https://snaps2.knuddels.de:8443/snap_download.html?magicInfo=GTw0ptLJJnnxNMcNmttaIOzJ5usavsV6GDYLthHpHEa7NooTGBl1EZb_30dXeB2bemO-LzU_ASFgOLNvHDPxw2G2_K9IVy3cdoh--GrU58U1YcXB0fpV9WJgpLaPJAOPI4s5pd_flq8fJrC-FXOvodSFDX1owKHrjZ_UYw33QcB7p8TBzTAAJN7v_40i4bW2a&.html' /></td>\r\n" +
" <td>https://snaps2.knuddels.de:8443/snap_download.html?magicInfo=...&.html\r\n" +
" <div class=\"gray\">(ging nicht, weil fragt http://snaps2.knuddels.de:8443/crossdomain.xml an statt https://snaps2.knuddels.de:8443/crossdomain.xml)</div>\r\n" +
" <div class=\"green\">Geht nun doch mit: <j2se version=\"1.6+\" java-vm-args=\"-Djnlp.altCrossDomainXMLFiles=https://snaps1.knuddels.de:8443/crossdomain.xml,https://snaps2.knuddels.de:8443/crossdomain.xml\" /></div>\r\n" +
" <div class=\"green\">Alternative Lösung: Standard-SSL-Port 443 verwenden + crossdomain.xml unter http:80 ausliefern.</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='jar:http://local.testserver.knuddels.de:2710/knuddelsk90loc.jar!/base/pPanel/skateboard3.jpg' /></td>\r\n" +
" <td>jar:http://local.testserver.knuddels.de:2710/knuddelsk90loc.jar!/base/pPanel/skateboard3.jpg\r\n" +
" <div class=\"red\">(aus jar, lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgBAQkIBwgKAQELDRYPDQwMDRsUFRAWIB0iIiARHxMkKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc0NCs3Nzc3NDc3Nzc3Nyw0NDc3Nzc3Nzc3Nzc3Nzc3Nzc3NzQ0Nzc3Nzc3N//AABEIABAAEAMBEQACEQEDEQH/xAAXAAADAQAAAAAAAAAAAAAAAAADBQYC/8QAKBAAAgEDAgUDBQAAAAAAAAAAAQIDBAURBwgABhIhcTFCUQkTIjJD/8QAFwEBAAMAAAAAAAAAAAAAAAAAAgAEBf/EAB4RAAICAgMBAQAAAAAAAAAAAAECAAMRQRITUTEh/9oADAMBAAIRAxEAPwCg5kvNTue1nuSLFJz7t7t7tG8XsUKSrSMvu/IN65wB54z7rGZiB8EoWuXYjQmKOvOwXRCkvCuNHeXp5MiiQdKzQj9pOj0Bx3B8fPERutQx3qRW61De6hb7Z7rsC37T3q2U0mtG3qqZnmiRS2eru8bIMnBOSCAeHZU6Wdifvojet0s5oM5i6GyXb6s+8BaqspZdJdugYK33IzGI4h/FVYAkn5xjueAtNltnNxgQCp7X5OMCf//Z' /></td>\r\n" +
" <td>data:image/jpeg;base64,...\r\n" +
" <div class=\"red\">(aus data-protocol)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://bilder.bild.de/fotos/logo-2014-35166394/Bild/9.bild.png' /></td>\r\n" +
" <td>http://bilder.bild.de/fotos/logo-2014-35166394/Bild/9.bild.png\r\n" +
" <div class=\"red\">(OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='https://www.google.de/images/srpr/logo11w.png' /></td>\r\n" +
" <td>https://www.google.de/images/srpr/logo11w.png\r\n" +
" <div class=\"red\">(OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" </table>\r\n" +
" </body>\r\n" +
"</html>");
}
private static class HTMLPanel extends JPanel
{
private static final long serialVersionUID = -6272445527425893706L;
private final JFXPanel jfxPanel = new JFXPanel();
private WebEngine engine;
private volatile boolean isInitialized;
public HTMLPanel()
{
super(new BorderLayout());
Platform.setImplicitExit(false);
}
private void initComponents()
{
if (!isInitialized)
{
this.isInitialized = true;
createScene();
this.add(jfxPanel, BorderLayout.CENTER);
}
}
private void createScene()
{
Platform.runLater(new Runnable()
{
public void run()
{
WebView view = new WebView();
engine = view.getEngine();
engine.getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>()
{
public void changed(ObservableValue<? extends Throwable> o, Throwable old, final Throwable value)
{
if (engine.getLoadWorker().getState() == State.FAILED)
{
System.out.println((value != null) ? engine.getLocation() + "\n" + value.getMessage() : engine.getLocation() + "\nUnexpected error.");
}
}
});
jfxPanel.setScene(new Scene(view));
}
});
}
public void setHTMLContent(final String htmlContent)
{
initComponents();
Platform.runLater(new Runnable()
{
public void run()
{
HTMLPanel.this.engine.loadContent(htmlContent);
}
});
}
}
}
Inside it there is only one WebView with some simple HTML.
When i hold and drag the middle mouse-button diagonally (sideways + up/down) then the view is moved, but not painted correctly and i get a kind of smear effect. Some parts update correctly (i guess those near the animated gif).
When i scroll using the mousewheel the damaged areas repair themselves once they scroll out and into the view again. But the parts that stay visible remain damaged.
I don't know if this only applies to sandboxed applets, i believe not.
Sample applet code:
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker.State;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javax.swing.JPanel;
public class JavaFXTest extends Applet
{
private static final long serialVersionUID = -7110935176335971839L;
public JavaFXTest()
{
super();
addMouseWheelListener(new MouseWheelListener()
{
public void mouseWheelMoved(MouseWheelEvent e)
{
e.consume(); // prevent MouseWheel Events to bubble up to the web-page.
}
});
}
@Override
public void init()
{
setLayout(new BorderLayout());
HTMLPanel htmlPanel = new HTMLPanel();
add(BorderLayout.CENTER, htmlPanel);
htmlPanel.setHTMLContent("<html>\r\n" +
" <head>\r\n" +
" <base href=\"http://local.testserver.knuddels.de:2710/\" />\r\n" +
"\r\n" +
" <script type='text/javascript' src='/pics/js/firebug-lite/firebug-lite.js'></script>\r\n" +
" <!--\r\n" +
" <script type='text/javascript' src='http://www.getfirebug.com/firebug-lite.js#startOpened'></script>\r\n" +
" /htmldebug\r\n" +
" -->\r\n" +
" <style type=\"text/css\">\r\n" +
" * { background-color: rgb(0,0,0,0); }\r\n" +
" /*\r\n" +
" * { background-color: rgb(0,128,0,0); }\r\n" +
" * { background-color: rgba(0,128,0,0); }\r\n" +
" */\r\n" +
" .gray { color: #999; }\r\n" +
" .green { color: #080; }\r\n" +
" .red { color: #800; }\r\n" +
" img { max-height: 100px; }\r\n" +
" div { margin-top: 8px; background-color: skyblue; }\r\n" +
" div { background-color: rgba(50,50,255,0.1); }\r\n" +
" html { background-color: rgba(50,50,255,0.1); }\r\n" +
" body { background-color: rgba(50,50,255,0.1); }\r\n" +
" </style>\r\n" +
" </head>\r\n" +
" <body>\r\n" +
" <base href=\"http://local.testserver.knuddels.de:2710/\" />\r\n" +
" <table border=\"1\">\r\n" +
" <tr>\r\n" +
" <td><img src='/pics/auction/auctionButton.png' /></td>\r\n" +
" <td><base> + /pics/auction/auctionButton.png\r\n" +
" <div class=\"green\">(lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://local.testserver.knuddels.de:2710/pics/auction/auctionButton.png' /></td>\r\n" +
" <td>http://local.testserver.knuddels.de:2710/pics/auction/auctionButton.png\r\n" +
" <div class=\"green\">(lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='/pics/sm_abo_001A_biglaugh.gif' /></td>\r\n" +
" <td><base> + /pics/sm_abo_001A_biglaugh.gif\r\n" +
" <div class=\"green\">(animiert, lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='/pics/fotos/knuddels.de?n=Plex&noPic=0&cnt=0&idx=plex-pro0m0p&.de&.jpg' /></td>\r\n" +
" <td><base> + /pics/fotos/knuddels.de?n=Plex&noPic=0&cnt=0&idx=plex-pro0m0p&.de&.jpg\r\n" +
" <div class=\"green\">(lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://snaps.knuddels.de/knuddels.de/jam/james-pro0msq0p.img' /></td>\r\n" +
" <td>http://snaps.knuddels.de/knuddels.de/jam/james-pro0msq0p.img\r\n" +
" <div class=\"green\">(MIT crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://www.meinebasis.de/images/BlobboBig.png' /></td>\r\n" +
" <td>http://www.meinebasis.de/images/BlobboBig.png\r\n" +
" <div class=\"green\">(MIT crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='https://snaps2.knuddels.de:8443/snap_download.html?magicInfo=GTw0ptLJJnnxNMcNmttaIOzJ5usavsV6GDYLthHpHEa7NooTGBl1EZb_30dXeB2bemO-LzU_ASFgOLNvHDPxw2G2_K9IVy3cdoh--GrU58U1YcXB0fpV9WJgpLaPJAOPI4s5pd_flq8fJrC-FXOvodSFDX1owKHrjZ_UYw33QcB7p8TBzTAAJN7v_40i4bW2a&.html' /></td>\r\n" +
" <td>https://snaps2.knuddels.de:8443/snap_download.html?magicInfo=...&.html\r\n" +
" <div class=\"gray\">(ging nicht, weil fragt http://snaps2.knuddels.de:8443/crossdomain.xml an statt https://snaps2.knuddels.de:8443/crossdomain.xml)</div>\r\n" +
" <div class=\"green\">Geht nun doch mit: <j2se version=\"1.6+\" java-vm-args=\"-Djnlp.altCrossDomainXMLFiles=https://snaps1.knuddels.de:8443/crossdomain.xml,https://snaps2.knuddels.de:8443/crossdomain.xml\" /></div>\r\n" +
" <div class=\"green\">Alternative Lösung: Standard-SSL-Port 443 verwenden + crossdomain.xml unter http:80 ausliefern.</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='jar:http://local.testserver.knuddels.de:2710/knuddelsk90loc.jar!/base/pPanel/skateboard3.jpg' /></td>\r\n" +
" <td>jar:http://local.testserver.knuddels.de:2710/knuddelsk90loc.jar!/base/pPanel/skateboard3.jpg\r\n" +
" <div class=\"red\">(aus jar, lokal OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgBAQkIBwgKAQELDRYPDQwMDRsUFRAWIB0iIiARHxMkKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc0NCs3Nzc3NDc3Nzc3Nyw0NDc3Nzc3Nzc3Nzc3Nzc3Nzc3NzQ0Nzc3Nzc3N//AABEIABAAEAMBEQACEQEDEQH/xAAXAAADAQAAAAAAAAAAAAAAAAADBQYC/8QAKBAAAgEDAgUDBQAAAAAAAAAAAQIDBAURBwgABhIhcTFCUQkTIjJD/8QAFwEBAAMAAAAAAAAAAAAAAAAAAgAEBf/EAB4RAAICAgMBAQAAAAAAAAAAAAECAAMRQRITUTEh/9oADAMBAAIRAxEAPwCg5kvNTue1nuSLFJz7t7t7tG8XsUKSrSMvu/IN65wB54z7rGZiB8EoWuXYjQmKOvOwXRCkvCuNHeXp5MiiQdKzQj9pOj0Bx3B8fPERutQx3qRW61De6hb7Z7rsC37T3q2U0mtG3qqZnmiRS2eru8bIMnBOSCAeHZU6Wdifvojet0s5oM5i6GyXb6s+8BaqspZdJdugYK33IzGI4h/FVYAkn5xjueAtNltnNxgQCp7X5OMCf//Z' /></td>\r\n" +
" <td>data:image/jpeg;base64,...\r\n" +
" <div class=\"red\">(aus data-protocol)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='http://bilder.bild.de/fotos/logo-2014-35166394/Bild/9.bild.png' /></td>\r\n" +
" <td>http://bilder.bild.de/fotos/logo-2014-35166394/Bild/9.bild.png\r\n" +
" <div class=\"red\">(OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" <tr>\r\n" +
" <td><img src='https://www.google.de/images/srpr/logo11w.png' /></td>\r\n" +
" <td>https://www.google.de/images/srpr/logo11w.png\r\n" +
" <div class=\"red\">(OHNE crossdomain.xml Permission)</div>\r\n" +
" </td>\r\n" +
" </tr>\r\n" +
" </table>\r\n" +
" </body>\r\n" +
"</html>");
}
private static class HTMLPanel extends JPanel
{
private static final long serialVersionUID = -6272445527425893706L;
private final JFXPanel jfxPanel = new JFXPanel();
private WebEngine engine;
private volatile boolean isInitialized;
public HTMLPanel()
{
super(new BorderLayout());
Platform.setImplicitExit(false);
}
private void initComponents()
{
if (!isInitialized)
{
this.isInitialized = true;
createScene();
this.add(jfxPanel, BorderLayout.CENTER);
}
}
private void createScene()
{
Platform.runLater(new Runnable()
{
public void run()
{
WebView view = new WebView();
engine = view.getEngine();
engine.getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>()
{
public void changed(ObservableValue<? extends Throwable> o, Throwable old, final Throwable value)
{
if (engine.getLoadWorker().getState() == State.FAILED)
{
System.out.println((value != null) ? engine.getLocation() + "\n" + value.getMessage() : engine.getLocation() + "\nUnexpected error.");
}
}
});
jfxPanel.setScene(new Scene(view));
}
});
}
public void setHTMLContent(final String htmlContent)
{
initComponents();
Platform.runLater(new Runnable()
{
public void run()
{
HTMLPanel.this.engine.loadContent(htmlContent);
}
});
}
}
}