0

I developed a Java desktop application in eclipse IDE.I need to include web view to a particular site(php) on a button in my JavaFrame.How is that possible?please help.

2 Answers 2

1

Do you want to open PHP page from your developed application?

In case you want to open URL in browser use Runtime. Please find the article: http://www.mkyong.com/java/open-browser-in-java-windows-or-linux/.

If you want to show the web-page in your java application you can use jdic. You can find jdic APIs and forum here: http://java.net/projects/jdic.

Sign up to request clarification or add additional context in comments.

6 Comments

Runtime? Where have you been hiding since December 2006?
@jaxb thank you.. I tried the first one. But not able to open in google chrome browser.changed the code as below.. String[] browsers = {"epiphany", " Google Chrome", "mozilla", "konqueror", "netscape","opera","links","lynx"};
@Andrew: by Runtime I mean Runtime class. Is there any issue regarding using it here? Link: docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html
@jaxb please can you modify the code to get opened in google chrome?
"by Runtime I mean Runtime class." Got that, it was just the date I was checking. "Is there any issue regarding using it here?" Runtime is one of those classes that people report 'everything works fine - here, breaks on next OS/machine etc.' . It is inherently clunky to be calling OS specific functionality in an x-plat app. That is where the Desktop class (1.6+) comes into its own. See my answer for links. I note from your link that it works for 'Windows & Linux' - what about OS X?
|
1

See Desktop.browse(URI) which:

Launches the default browser to display a URI. If the default browser is not able to handle the specified URI, the application registered for handling URIs of the specified type is invoked. The application is determined from the protocol and path of the URI, as defined by the URI class. ..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.