barryku
barryku

Reputation: 2594

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.

enter image description here

Upvotes: 0

Views: 274

Answers (1)

codingchris
codingchris

Reputation: 36

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

Upvotes: 2

Related Questions