This content has been marked as final. Show 6 replies
Doh! I'm an idiot! The second block of code worked fine once I passed a URL instead of an HTML string!
May others learn from my mistakes...
Edited by: edward17 on Nov 3, 2012 5:58 AM
I advise using the JavaFX form:
Yeah...um...or that...*goes to simplify code*
ah good, I was looking for an alternative to Desktop because on the mac I get headless mode error each time I try to open a URL, despite the fact that I test for Desktop support beforehand.
Now the remaining issue is that I can't print either (through AWT) because I get HeadlessException when doing that too... Can't wait for printing support to be added... :/
EDIT - judging from the method documentation, it does not replace other Desktop integration (ie: opening XL, PDF and image files) either :(
Edited by: bouye on Dec 5, 2012 10:34 AM
EDIT2 - after test, unlike what the doc says about the "browser", it works like Desktop.open(), at least on Windows. :)
Edited by: bouye on Dec 5, 2012 10:54 AM
Now the remaining issue is that I can't print either (through AWT) because I get HeadlessException when doing that tooI get that from time to time on the Mac too. Don't know what it's related to, maybe something about using AWT and JavaFX routines in parallel. It's weird because there is definitely a display and graphics displays on it, so there is a head. Other than the warning message printed to syserr, it does not appear to have other negative consequences. There is a jira issue to track it http://javafx-jira.kenai.com/browse/RT-20784 "Headless environment issue, MacOSX"