This content has been marked as final. Show 5 replies
Java 6+ has a Desktop class with which you can invoke the system default browser to display an URL. Which may just be IE of course.1 person found this helpful
Don't know if that will force the browser to the foreground, as soon as the process spawns you have no control over it anymore and you're at the mercy of the OS.
Thanks for the suggestion. That does indeed cause the browser to open on top of other applications, but it still leaves me with a few different issues. I want the displayed page to take up the entire screen, hence launching IE in kiosk mode, which I don't see a way to do through the Desktop class. I also need to be able to close the browser window when I want the message to go away. In the current implementation, I'm doing this by calling the destroy() method of the Process returned from Runtime.exec().
I guess you'll have to live with the browser not popping to the front then. You might investigate if there are more launch options for IE that do what you need, that is beyond this forum to answer.
I understand that the message is HTML. If it is simple HTML, Java itself can quite easily render it, as described here: http://docs.oracle.com/javase/tutorial/uiswing/components/text.html.
You have better control than over an external process.
If your messages are too complex for Swing based rendering, google for "java embedded browser".
Unfortunately it isn't just simple HTML. Some of the pages I need to display are Oracle Application Express pages that dynamically generate content based on parameters passed in the URL. My first attempt actually involved using a JEditorPane to display the content, but it did a horrible job of rendering most of what I need to show. sigh I guess I'm going to be learning how to embed a browser into a java program.