Why is WebView content fading out (disappearing)?

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.

Answers


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 ); 

Need Your Help

What's the best way to remove HTML from a string?

regex coldfusion

I recently started using the following RegEx in a ReReplace() function to strip HTML tags from a string using ColdFusion. Please note: I am not using this as protection from XSS or SQL injection; t...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.