Opening a browser from a swing application

hi,
I want to open a browser (with specific URL) from my application, on the actionEvent of certain Button. Is it possible ? If any body is aware of it plz help me.
Thanks
Atul

Try out the following site,
http://www.stanford.edu/~ejalbert/software/BrowserLauncher/
rgds
Ravi

Similar Messages

  • Open default browser from a java application

    How is possible to make a java application that open an html file in the default browser ?
    Thankyou
    [email protected]

    You can do that by running the command "start <url>", for example using Runtime.exec().
    Runtime.getRuntime().exec("start http://java.sun.com");Jesper

  • Open a browser from swing panel

    How can we open a browser from a swing panel? I want to open a browser from my panel, when i hit on a button or a link?
    Second question how can i create a link in a panel?
    Thanks

    odd, someone just asked that:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=555001&tstart=0&trange=15

  • Problem in Opening HTML Page in Internet Explorer from my Swing Application

    Hi,
    I am opening a HTML file in Internet Explorer from my swing application.I am using the code given below
    private final static String WIN_FLAG = "url.dll,FileProtocolHandler";
    private final static String WIN_PATH = "rundll32";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
    // url is HTML file Path
    Process p = Runtime.getRuntime().exec( cmd );
    Here there are two things i need to address ...
    1)The HTML file is opening up,but it always opens behind the swing application,that makes me every time to maximize the HTML file after it being opened up.I want to open it in front of the Swing Application.I need to implement "Always On Top" functionality for the html page.
    2)Whenever i trigger action to open different HTML page,it opens in new Internet Explorer window.
    I need to open it in same IE window.
    how to solve out these problems ??? any help would be greatly appreciated .Thanks in advance.
    - Manikandan

    any idea about this ????

  • 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.

  • How do I save and import my bookmarks from another hard drive? When I try to open the installed Firefox on the old drive, it (obviously) opens a browser from the new main drive, free of bookmarks. Is there a way I can save the bookmarks on the old drive w

    How do I save and import my bookmarks from another hard drive? When I try to open the installed Firefox on the old drive, it (obviously) opens a browser from the new main drive, free of bookmarks. Is there a way I can save the bookmarks on the old drive without opening a browser?
    The guts of my computer were rearranged and I got a new main hard drive. My old one is still in there and I can get stuff from it, but when I go to the Mozilla folder on the old one, I can't figure out if there's anything I can do to get all my bookmarks from that drive to my new one, where Firefox is newly installed.

    If you open Firefox then Firefox will always use the default profile folder as found via profiles.ini on your system drive.
    You either need to import the file in your current default profile or copy the file to your current profile folder while Firefox is closed.
    Firefox 3 stores the bookmarks and the browser history in [http://kb.mozillazine.org/places.sqlite places.sqlite] and no longer creates an HTML backup by default.
    There are also (five) JSON backups in the bookmarkbackups folder within the Firefox profile folder.
    You can either copy the file places.sqlite to your [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] or import the most recent JSON backup from the bookmarkbackups folder of that old profile.
    See:
    http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox
    http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    See http://kb.mozillazine.org/Profile_folder_-_Firefox
    "Application Data" in XP/Win2K and "AppData" in Vista/Windows 7 are hidden folders.
    See http://kb.mozillazine.org/Show_hidden_files_and_folders
    Go to: Control Panel > Folder Options > "View" tab > under "Hidden files and folders", select "Show hidden files and folders".
    You may want to un-check the box "Hide extensions for known file types" to see the file extensions of all files.

  • Launching Adobe Viewer from a Swing application

    How do I launch Adobe Viewer (or Reader) from my Swing application. I have a help menu item that needs to open the viewer with the PDF help manual. Since the application is cross-platform, do I need different versions of Adobe with my install package? Thanks for any help.

    Thanks. I tried the adobe bean and it seems to work fine until I select the "Print" icon. It crashes the Viewer and my application as well. I get the following:
    Any suggestions?
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 11 occurred at PC=0xff2c614c
    Function name=realloc
    Library=/lib/libc.so.1
    Current Java thread:
    at sun.awt.motif.MTextFieldPeer.create(Native Method)
    at sun.awt.motif.MComponentPeer.init(MComponentPeer.java:169)
    at sun.awt.motif.MComponentPeer.<init>(MComponentPeer.java:179)
    at sun.awt.motif.MTextFieldPeer.<init>(MTextFieldPeer.java:68)
    at sun.awt.motif.MToolkit.createTextField(MToolkit.java:85)
    at java.awt.TextField.addNotify(TextField.java:194)
    at java.awt.Container.addNotify(Container.java:1579)
    at java.awt.Panel.addNotify(Panel.java:74)
    at java.awt.Container.addNotify(Container.java:1579)
    at java.awt.Window.addNotify(Window.java:349)
    at java.awt.Dialog.addNotify(Dialog.java:247)
    at java.awt.Window.pack(Window.java:367)
    at com.adobe.acrobat.gui.PDFPrint$PageRangeDialog.<init>(PDFPrint.java:144)
    at com.adobe.acrobat.gui.PDFPrint.<init>(PDFPrint.java:18)
    at com.adobe.acrobat.gui.PrintUI.printPages(PrintUI.java:183)
    at com.adobe.acrobat.gui.PrintUIVerb$PrintTransactor.printFileWithUI(PrintUI.java:591)
    at com.adobe.acrobat.gui.PrintUIVerb$PrintTransactor.buildChanges(PrintUI.java:556)
    at com.adobe.pe.notify.Transactor.commit(Transactor.java:44)
    at com.adobe.pe.awt.UIVerb$1.buildChanges(UIVerb.java:151)
    at com.adobe.pe.notify.Transactor.commit(Transactor.java:70)
    at com.adobe.pe.awt.UIVerb.invoke(UIVerb.java:51)
    at com.adobe.pe.awt.ToolBar.mouseReleased(ToolBar.java:419)
    at java.awt.Component.processMouseEvent(Component.java:3715)
    at java.awt.Component.processEvent(Component.java:3544)
    at java.awt.Component.dispatchEventImpl(Component.java:2593)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
    at java.awt.Container.dispatchEventImpl(Container.java:1200)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    Dynamic libraries:
    0x10000 /shared/j2sdk1_3_1/bin/../bin/sparc/native_threads/java
    0xff360000 /lib/libthread.so.1
    0xff3a0000 /lib/libdl.so.1
    0xff280000 /lib/libc.so.1
    0xff260000 /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
    0xfe480000 /local/j2sdk1_3_1/jre/lib/sparc/client/libjvm.so
    0xff210000 /lib/libCrun.so.1
    0xff1f0000 /lib/libsocket.so.1
    0xff100000 /lib/libnsl.so.1
    0xff1c0000 /lib/libm.so.1
    0xff240000 /lib/libw.so.1
    0xff0e0000 /lib/libmp.so.2
    0xff0a0000 /local/j2sdk1_3_1/jre/lib/sparc/native_threads/libhpi.so
    0xff070000 /local/j2sdk1_3_1/jre/lib/sparc/libverify.so
    0xff030000 /local/j2sdk1_3_1/jre/lib/sparc/libjava.so
    0xfe450000 /local/j2sdk1_3_1/jre/lib/sparc/libzip.so
    0xfd060000 /local/j2sdk1_3_1/jre/lib/sparc/libawt.so
    0xf4880000 /local/j2sdk1_3_1/jre/lib/sparc/motif21/libmawt.so
    0xfd010000 /shared/j2sdk1_3_1/bin/../jre/lib/sparc/libmlib_image.so
    0xf4600000 /lib/libXm.so.4
    0xf4580000 /lib/libXt.so.4
    0xfafd0000 /lib/libXext.so.0
    0xfafa0000 /usr/openwin/lib/libXtst.so.1
    0xf4480000 /lib/libX11.so.4
    0xfac60000 /lib/libSM.so.6
    0xfac30000 /lib/libICE.so.6
    0xf4380000 /local/j2sdk1_3_1/jre/lib/sparc/libfontmanager.so
    0xf4ba0000 /usr/openwin/lib/libdps.so.5
    0xf4860000 /shared/j2sdk1_3_1/bin/../jre/lib/sparc/libsunwjdga.so
    0xf4830000 /usr/openwin/lib/libdga.so.1
    0xf4560000 /shared/j2sdk1_3_1/bin/../jre/lib/sparc/libxinerama.so

  • Launch a default web browser from my java application

    Hello,
    I have been trying to launch my default web browser from my java application, but am unable do it. Right now, I am using ---- "Runtime.getRuntime().exec("cmd /c start <url>"); to launch my webbrowser. It launches the browser but displays the command prompt for a second or so, and then replaces my already existing page with the new url.
    Is there any way for me to launch the url in a completely new browser each and every time. And I don't want the command prompt to show up for a sec. Please help...!
    Thanks in advance.
    -BusyBusyBee

    If by any chance your application is an Applet, you can use this to open a new browser window:
    getAppletContext().showDocument(new URL(theUrl), "_blank");
    But, you probably would have specified if that were the case. Oh well. Hope it helps someone!
    -sheepy.

  • How do you run a (Word) Document from a Swing application

    I want to create a Word Document and then open it from a Swing application. If you can't do that directly, what else can you do to get that result.

    gwils wrote:
    How do you recover a word document on a macbook pro?
    Just as you do it on a Mac Pro or a Mac Mini.
    What version of Mac OS X? What version of MS Word?
    If you're thinking of the AutoRecover feature, you have to enable it first. If it was enabled, this
    <http://kb.iu.edu/data/ahnd.html#FindingfilesMac>
    will tell you what to do.

  • Opening a browser from an applet

    I got a problem, I want to open a browser from my applet, but I just found one way:
    getAppletContext().showDocument(new URL(
    "http://www.java.sun.com"), "_blank");
    but the problem is: with this, the default browser with defaul settings is opened, and that's what I don't want...
    how can I open the browser with some settings (for example size, or no-url-bar, etc)
    thx for help

    hi,
    try this code:
    public void showDocument(java.net.URL url, String targetWindow)
    when targetWindow can be:
    "_blank" Display the document in a new, nameless window.
    "windowName" Display the document in a window named windowName. This window is created if necessary.
    "_self" Display the document in the window and frame that contain the applet.
    "_parent" Display the document in the applet's window but in the parent frame of the applet's frame. If the applet frame has no parent frame, this acts the same as "_self".
    "_top" Display the document in the applet's window but in the top-level frame. If the applet's frame is the top-level frame, this acts the same as "_self".

  • Safari keeps crashing every time I try to open a link from a different application, i.e. Mail. The trouble report says that some problem occurs with libcooliris.dylib plug-in. Can any one help?

    Safari keeps crashing every time I try to open a link from a different application, i.e. Mail. The trouble report says that some problem occurs with libcooliris.dylib plug-in. Can any one help?
    Thanks!

    Dear Linc,
    Thank you for the advice, John Blanchard1  and Linc Davis
    As suggested in your reference thread I removed "/Library/Printers/hp/PDEs/hpPostScriptPDE.plugin" and the problem has been resolved.
    I am guessing the the plug-in for the hp printers got corrupted and effected every thing, or became unsuitable when I installed an Apple update. I would be most grateful if you can confirm how the problem was coursed so I can understand and learn from this experiance.
    Ash

  • Browser enabled InfoPath form not opening in browser from a link in a Task list

    I have a browser enabled InfoPath deployed to SharePoint as a template in a Forms Library. The form opens in the browser when a user navigates to the Form library and clicks New.
    There is an Approval workflow associated with this form which kicks in whenever a new Form is submitted. The workflow creates a task in a task list. The task list shows a Link column which provides the link to open the form. Now, when a user clicks on the
    link (in the Task list), the form always open in InfoPath instead of opening in a browser.
    I see that the URL for the form (http://<Server>/Training/Enrollment%20Forms/<FormName>.xml)  is same in both the Forms Library and Task list link.
    What am I doing wrong or what do I need to do to make the form open in browser from the Task list link.
    Thanks
    Rajat

    This question is asked constantly - we just discussed this last week, I believe - so you can probably find a lot more discussion to help you out if yous earch within this form or browse through the topics.  The reason for your issue is because of
    what you just wrote - the URL is directly to the XML file, so it tries to invoke InfoPath.  Browser forms are rendered by Forms Services, which has a much different URL.  Go click on one of your existing forms, and notice how different the URL is. 
    To get forms to open in the browser when invoked from a different location, you must use this full Forms Services URL.  Built-in workflows only generate a link to the XML file, and since the task in a different list than the form, then it has no idea
    how to open the form in the browser.  Only users who don't have InfoPath installed will see it in the browser automatically.  This is why I generate my own URLs dynamically with custom workflows and don't use OOTB workflows.SharePoint Architect || Microsoft MVP ||
    My Blog

  • How to invoke a JAR from Java Swing application?

    Hi,
    I am trying to start a jar file from the swings application.
    I am trying the following code,
    String cmd[] = new String[]{"cmd", "java -jar TestJFreeChart.jar"};
    try
           Process run = Runtime.getRuntime().exec(cmd);
    catch(Exception e)
    {}Is anything wrong in the usage?

    First try:
    "cmd /c java -jar app.jar" or cmd start, because it can't jsut run java.exe, it needs to be
    passed to the cmd interpretor witch further calls java.exe, etc
    Also read what stevejluke suggested. Its important to know if .waitFor or not.
    You wont understand these until you read the tutorial.

  • Attempting to launch a help browser from a java application

    I am currently investigating being able to view help html files through launching a browser from my Java application. I have come across the java.lang.Runtime and java.lang.Process classes which allow me to launch a browser like Netscape or Explorer and bring up a html file to view.
    What I want to do is launch the browser and bring up an html index file as well as the required html help file every time a user would like to use the help for my application.
    Is this possible using the other exec commands. If so, how? Is there somewhere I can find a user guide for Netscape and Explorer commands in order to send additional commands to the browser in order to do this.
    Thanks.

    Good news is it must be possible because VisualAge does it but I don't know how.

  • Why does it take 3 goes to open my browser from my desk top?

    It takes me 3 attempts to open my browser from my desktop icon. 3 lots of double clicks before Firefox will open. Things changed about a week ago. All was well before then. What has happened?

    I would have thought if you select a program to come to the forefront it is
    "active"and ready to use?  Is this an issue or am I doing something wrong? 
    Thanks
    Tried this on my setting but after having clicked on the icon the Bridge
    window is present, ready and active. No need for an click here.
    Have you already tried system maintenance for OS using Apple Disk utility to
    check and repair permissions?

Maybe you are looking for