Opening  browser window from Java Swing

Hi
I am trying to open
1) a word document on the click of a button from a Java-Swing based application running only on windows based system.
Currently the code uses 'rundll' and calls 'a.doc'
it requires that the application be installed and run only from a specific location in the windows' system.
i would like to modify the code in one of the following ways
1) open the word doc irrespective of its location and that of the executable jar which is trying to open this file
2) upload the word document to a website and direct the application to open that webpage on button click, etc
i believe that the latter may be simple but i do not have any idea about how to go about it
i would appreciate some guidance about it.

Hi,
I was trying to run the code, for embeding the mozilla web browser in my java application which is running at linux fedoracore2. I set all the environment variables, like MOZILLA_FIVE_HOME and LD_LIBRARY_PATH. I can able to compile successfully but if i run the code, i got the error message like this
Exception in thread "main" java.lang.Error: Untranslated exception
at sun.nio.ch.Net.translateToSocketException(Net.java:63)
at sun.nio.ch.Net.translateException(Net.java:79)
at sun.nio.ch.Net.translateException(Net.java:85)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:61)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at org.jdesktop.jdic.browser.MsgClient.<init>(Unknown Source)
at org.jdesktop.jdic.browser.NativeEventThread.<init>(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser.<clinit>(Unknown Source)
at IEInJava.main(IEInJava.java:8)
Caused by: java.net.SocketException: Unresolved address
at sun.nio.ch.Net.translateToSocketException(Net.java:55)
... 8 more
Caused by: java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:30)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:115)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
... 5 more
Thats the error.
I could not find out, where i had made the mistake, i need help. Any suggestion and comments are most welcome. Thanks.

Similar Messages

  • Opening browser windows from applet

    I have 2 questions
    1) Does anyone know, what do I have to do to force my java applet to open new browser window with specified url ?
    2) Is any java class, which renders HTML files ? I'm trying to open some document in frame inside applet and I don't know if i have to write this renderer by myself.

    for your second question, I dont know if there is a specific HTML class but SAXParser makes reading xml very easy and you probably should have much trouble writing a class to read html.

  • Opening browser window From Application

    i have an applet that uses the showDocument() method which opens a browser window. I would like to have the same thing happen from my application , but i can not use the applet method showDocument()
    does anyone know how to open a new browser windo using another method?
    Thanks alot for any help cause I have tried to find the anser asnd can not
    ..

    Or use a more cross-platform capable solution such as that found here: http://ostermiller.org/utils/Browser.html

  • Can't open browser window from RoboHelp AIR app??!

    We've got a RoboHelp course that we're exporting as an AIR app using the  Packager and it works great. We've got an embedded flash file that  needs to open a website in a browser window, but, currently it will only  load the site in a new AIR window...any ideas??

    I'm having this same problem also, although you gave me one option in your reply.  I can't get the "Allow" button to work either. I upgraded to Adobe Reader 9.2, and then is when I noticed I couldn't bring up the websites that I usually could before.  I don't really know what you mean about "Stand Alone Option," but I will try to find out.  I also upgraded to Internet Explorer 8, but I'm not sure if this is when the problem started or when I went to Adobe Reader 9.2.
    I used to be able to get "Allow" to work if I opened the document in IE8 and not in AR 9.2, but now that won't even work. I did email the author of a PDF document I was in today in the hopes he would have the answer, but I'm not sure if I got his email address right, so time will tell on that issue.
    I have a "library" of PDF documents, so I would really like to get this problem fixed.  However, I've spent at least two hours on this issue, and I really don't think it has anything to do with Windows Vista incompatibility; I'm pretty sure it has something to do with Adobe Reader, but that doesn't help much given I have emailed support and, of course, have never received an answer.
    I do know there are a lot of people that are having this exact same problem, but no one has an answer to it.  I've tried to do research on this, but I have a lot of "to do" tasks I need to get done every day, so it's not like I have all the time in the world to try and fix this problem.
    I would appreciate hearing from you if you do ever figure this out. My email address is [email address deleted by host] should you find an answer to this very frustrating problem. Warmly, Corinne Larimore [signature deleted by host]

  • Opening Browser Window from Hotspot without Browser Toolbars, etc

    Hi Guys
    Can you help please.
    I have a map with some ponds. I've made hotspots for these ponds to open separate pages with some images and info but I really don't need the page to display the toolbars and favorites, etc. I have gone into behaviors and set them to open the browser as I want when I click on the hotspot. Fine. The trouble is it also opens a full browser window as well! Can anyone point me to hoe and where I can set the behaviors so I get only one browser window, without the toolbars, etc?
    Thanks & regards,
    Graham

    Making Pop-Up windows in DW
    http://alt-web.blogspot.com/2010/02/making-pop-up-window-in-dreamweaver.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • How to open browser window from standalone Java Application???

    Is it possible to start Internet Explorer from non-applet application?

    Something like that could maybe help:
    Runtime.getRuntime.exec("iexplore http://www.google.com");
    but it's not platform independent + I couldn't let it work in that way. It only worked with Runtime.getRuntime.exec("c:\\windows\\....\\iexplore.exe http://www.google.com");
    But it's surely not platform independent.
    So the answer is in fact 'I don't know'.
    And if you ask why am I writing all that then, the answer is 'I don't know' too.
    And if you ask why...

  • Open browser window behavior in Mac not working right

    I am simply selecting my text in my html document and then selecting "Open Browser Window" from the Behaviors panel.  I then put in the info for the file I want it to open along with the size, etc...
    When I test it in the browser (Safari) the link works but the rollover features don't show ... it doesn't show as a link in the browser window.  I followed the tutorial exactly and the instructor's browser showed the link as a rollover.  It's driving me a bit crazy.
    I'm using CS5 on the latest version on Mac OS (Snow Leopard).
    I can put up an example if needed.
    Thanks so much for any assistance.
    BC

    All I can tell you is that when you browse to that link URL, you do not see a JPG image, you see this page -
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Apartment Anchor - Free Apartment Locating Service | ApartmentAnchor.com</title>
    <style type="text/css">
    .content {
    width: 400px;
    a {
    font-size: 20px;
    </style>
      <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-25512543-2']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    </head>
    <body>
    <div class="content">
    <ol>
    <li><a href="http://apartmentanchor.com/blogs">Houston Apartment Blog</a></li>
    <li><a href="woodlands/woodlands-tx-apartments.html">Woodlands Texas Apartments</a></li>
    <li><a href="clear-lake/clear-lake-tx-apartments.html">Clear Lake Texas Apartments</a></li>
    <li><a href="cypress-texas/cypress-tx-apartments-for-rent.html">Cypress Texas Apartments</a></li>
    <li><a href="river-oaks/houston-river-oaks-apartments.html">Houston River Oaks Apartments</a></li>
    <li><a href="spring-texas/spring-apartments-for-rent.html">Spring Texas Apartments</a></li>
    <li><a href="league-city/league-city-tx-apartments.html">League City Texas Apartments</a></li>
    <li><a href="houston-texas-apartment-search-engine.html">Houston Apartment Search Engine</a></li>
    <li><a href="get-availability-information.html">Get Apartment Listing</a></li>
    </ol>
    </body>
    </html>
    Do you have that page on your site?  Is that your home page?
    Perhaps you have some hidden redirection going on via an htaccess file?  I dunno....

  • Open new browser window from a JApplet

    Hi,
    I want to open a new browser window from a JApplet.My first thought was to use the Live Connect technology but it worked only with simple applets not with JApplets.Then i tried it by getting the Applet context (getAppletContext() method) but it still didn't work with JApplet...(it worked with Applet).I believe it has something to do with the applet security but i haven't yet figured it out.
    For example when i call the getAppletContext() method from a JApplet i get an java.security.AccessControlException ... .Thanks

    I must correct myself now :).
    The getAppletContext() method does work with JApplets too.Still , i have problems with the Live connection alternative.It seems that it by importing the netscape.javascript package i get the security eror that i mention above...

  • How do I open a new browser window from Flash

    I wish to open a new browser window from Flash and when the new window closes to return to the location from whence I started.
    ThomasChen

    The command to open a new window would be the "_blank" part of a command to link to a web page in the code below.
    navigateToURL(new URLRequest("http://www.anothersite.com", "_blank"));
    As far as the new window closing and getting back to where you were in the original window, I don't understand where that original window might have gone to... You should be wherever you last left it.

  • Open new browser window from Hyperlink in BIP PDF output report?

    Hello,
    Is there a way to open a new browser window from Hyperlink in PDF report?
    Thank you all in advance.
    MT

    Dear Friend,
    It is not supported for PDF Report. But below links helps you, to accombish this task in PDF report.
    [url http://oracleapps4u.blogspot.com/2011/03/open-hyperlink-in-new-browser-window.html]http://oracleapps4u.blogspot.com/2011/03/open-hyperlink-in-new-browser-window.html
    Thanks & Regards
    Ahamed Rafeeque Cherkala

  • How can I open a new browser window from UIX?

    I need to open a new browser window from an event handler. How that can be done? HELP!
    Thanks!
    Martin Patrici

    HTML doesn't really let you do this on the server side; the client is in charge
    of creating new windows, not the server.
    If you know that clicking a certain link/button, etc. will always raise a new window,
    then you should use Javascript or "targetFrame" accordingly.
    If the decision will only be made on the server side, then you could reload the current
    window, only this time use an "onLoad" on the <body> to raise a window.

  • Opening new browser window from backing bean

    Is it possible to open new window from backing bean?
    Regards, Simy

    quite sure its not possibleIt is possible !! But a fifferent way of doint it!
    I assume this is what you want ! on click of a button you want to go to the backing bean and come back with the new page on a new window !!
    Do the following! On click of a button, call a javascript method which does the following
    window.open('/jsf/somepage.jsf',.....)In the constructor of the backing bean, do the backend processing and set the fields of teh backing bean. And when the page gets rendered its as good as what you want...

  • Viewing and printing a PDF file from Java Swing Application

    Hello,
    I need to view and print PDF files from Java Swing Application.How do I do that?I appreciate your help.
    Thank you
    Sumana Somareddy

    If you have a link to the URL pointing to the PDF file, you can allow the browser to open it. Then use the print function of the browser to print the PDF document.
    Regards,
    Tak.

  • Opening secondary window from javahelp window activated from modal dialog

    hello,
    has anyone had this problem before? I open javahelp from a dialog with setActivationWindow(modalDlg), but then, opening secondary windows from that javahelp appear hidden, unreachable because of the modal windows (the dialog and the help window). is there a solution for this?

    Christian,
    This problem is occuring on 2 machines which has Java 1.5. But rest of the machines which has 1.5,1.6,1.4 are supporting modal windows. So not really sure whether its a browser issue or JRE issue or it is how the modal windows behave in an inconsistent way. Really need a solution for this problem as early as problem.
    Regards,
    Rajesh.

  • Closing browser window from an Applet?

    I've written a series of applets that perform different functions. I placed a button on each applet with the purpose to close the window in which that applet is running. However I don't even know where to start looking to find out how to make my applet close it's own browser window. I know how to open a new browser window from an applet but not vice versa.
    Can anyone help please?
    Mark.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

Maybe you are looking for