我在 Webview 的浏览器中加载了一个 html 文件。它显示得很好,但是如果我尝试将窗口调整为最小尺寸(小于 200 px 高度),eclipse 会抛出异常。
我的环境:Linux Suse 12.3、JDK 1.7.0_45、JavaFX 2.2、编译器合规级别 1.7。
这是代码:
public class HTMLView extends BorderPane {
final WebView browser = new WebView();
final WebEngine webEngine = browser.getEngine();
public HTMLView(String fileName) {
webEngine.load(fileName);
setCenter(browser);
}
}
.html 文件:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Info Board</title>
<style type="text/css">
body{
font-weight: normal;
font-family: Arial, Serif, Tahoma, Verdana;
font-size: 12px;
padding: 10px;
background: #330000;
}
.box{
margin-top: 100px;
border-top: 1px solid #F3F3F3;
-moz-box-shadow: 0 0 8px 1px rgba(0,0,0,0.8);
-webkit-box-shadow: 0 0 8px 1px rgba(0,0,0,0.8);
-o-box-shadow: 0 0 8px 1px rgba(0,0,0,0.8);
box-shadow: 0 0 8px 1px rgba(0,0,0,0.8);
padding: 10px;
background: #FFFFFF;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
}
</style>
</head>
<body>
<div class="box">
<img src="logo.png" style="float: right;"/>
<span style="font-size: 14px; font-weight: bold;">Test Test</span>
<ul>
<li>Test Test</li>
<li>Test Test</li>
<li>Test Test</li>
<li>Test Test</li>
<li>Test Test</li>
</ul>
<span style="font-size: 14px; font-weight: bold;">Test Test</span>
<ul>
<li>Test Test</li>
<li>Test Test</li>
<li>Test Test</li>
<li>Test Test</li>
<li>Test Test</li>
<li>Test Test</li>
</ul>
</div>
</body>
</html>
例外:
java.lang.ArrayIndexOutOfBoundsException: 112622
at com.sun.prism.j2d.J2DPrismGraphics.doDrawMaskTexture(J2DPrismGraphics.java:1124)
at com.sun.prism.j2d.J2DPrismGraphics.drawPixelsMasked(J2DPrismGraphics.java:1010)
at com.sun.webpane.sg.prism.WCGraphicsPrismContext$ClipLayer.render(WCGraphicsPrismContext.java:1267)
at com.sun.webpane.sg.prism.WCGraphicsPrismContext.renderLayer(WCGraphicsPrismContext.java:174)
at com.sun.webpane.sg.prism.WCGraphicsPrismContext.restoreStateInternal(WCGraphicsPrismContext.java:191)
at com.sun.webpane.sg.prism.WCGraphicsPrismContext.restoreState(WCGraphicsPrismContext.java:204)
at com.sun.webpane.platform.graphics.GraphicsDecoder.decode(GraphicsDecoder.java:202)
at com.sun.webpane.platform.graphics.WCRenderQueue.decode(WCRenderQueue.java:67)
at com.sun.webpane.platform.WebPage.paint2GC(WebPage.java:661)
at com.sun.webpane.platform.WebPage.paint(WebPage.java:640)
at com.sun.javafx.sg.prism.NGWebView.renderContent(NGWebView.java:71)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:201)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:420)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:201)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:420)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:201)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:420)
at com.sun.javafx.sg.prism.NGNode.renderForClip(NGNode.java:443)
at com.sun.javafx.sg.prism.NGNode.renderRectClip(NGNode.java:334)
at com.sun.javafx.sg.prism.NGNode.renderClip(NGNode.java:360)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:193)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:420)
at com.sun.javafx.sg.prism.NGNode.renderForClip(NGNode.java:443)
at com.sun.javafx.sg.prism.NGNode.renderRectClip(NGNode.java:334)
at com.sun.javafx.sg.prism.NGNode.renderClip(NGNode.java:360)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:193)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:201)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:420)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:201)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:420)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:201)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:40)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1145)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:117)
at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(AbstractPainter.java:188)
at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:73)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at com.sun.prism.render.RenderJob.run(RenderJob.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:108)
at java.lang.Thread.run(Thread.java:744)
关于这个异常的原因的任何想法?非常感谢