为什么WebView内容逐渐淡出(消失)? [英] Why is WebView content fading out (disappearing)?

查看:226
本文介绍了为什么WebView内容逐渐淡出(消失)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在经历一种非常奇怪的行为,当我们移动鼠标时,WebView中的内容将消失。在添加相同的数据库访问代码之后,似乎更改了WebView的样式表。我已在。



hsql数据库将日志更改为更详细的级别,这会导致webview将调试模式切换为打开。所以你可能会告诉Webview关闭它的调试模式。 (用于检测布局问题。)






错误报告中发布的解决方法是:

  Logger logger = Logger.getLogger(
WCGraphicsPrismContext.class.getName()
);
logger.setLevel(Level.OFF);


We are experiencing a very weird behavior that the content in the WebView will disappear when we move mouse around. It seems the stylesheet of the WebView is changed after adding same database access code. I have modified the sample application at http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm a little bit to demonstrate this issue. The modified class has the following added code,

final JDBCDataSource dataSource = new JDBCDataSource();
dataSource.setUrl("jdbc:hsqldb:file:test.db/test");
dataSource.setUser("SA");
dataSource.setPassword("");
Connection conn = dataSource.getConnection();
conn.close();

The WebView works normally without any issues if the last two lines are commented out. I have created a Maven project with readme.txt for anyone who can help to run the app to see the weird behavior at https://app.box.com/s/dc9bd8f09m69o2iamvit.

解决方案

That's a known bug RT-23846 "WebView in Debug Mode if logging is enabled ".

The hsql database changes the log to a more detailed level and this causes the webview to switch the debug mode to on. So you probably would've to tell the Webview to switch off its debug mode. (Which is used to detect layout issues.)


The workaround posted in the bug report is:

Logger logger = Logger.getLogger( 
    WCGraphicsPrismContext.class.getName() 
);
logger.setLevel( Level.OFF ); 

这篇关于为什么WebView内容逐渐淡出(消失)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆