Help Needed in opening a HTML File from 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 );
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.
Any Help Please ?
- Manikandan

Check your Application's JFrame properties (may be ur Frame is set to be in top position ,always),and also check running your application in some other OS.

Similar Messages

  • I need to show an html file from an application

    Hi there!, I really need your help...
    I have the absolute path in an String variable:
    String fileHTML = "C:\\AllCitiHTML\\GeneralHTML_Files\\Temp\\2002030925General.htm";
    Now, I need to show this page in a browser(explorer or netscape) but the page must be showed in both.
    I tried with this code, but it doesn't show nothing
    String urlName = fileHTML;
    String browser = "iexplore ";
    Runtime.getRuntime().exec(browser + urlName);
    in addition it would only serve for explorer and not for netscape.
    reply this message with all the possible code that you can use...
    Please I need help very urgent, thanks

    Multiple cross-post.

  • When i open any .HTML file from my computer it is not opening in firefox. Only a blank New Window Opens. Facing this problem since the firefox has updated.

    Whenever i try to open any HTML file from my computer, it opens a new firefox window which is blank. Facing this problem after the new update. please fix this problem

    I found that after Firefox v29, a LOT of my settings and<BR>
    add-ons were changed / reset. Try this;
    '''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]'''''
    <BR>While you are in safe mode;<BR>
    '''''Firefox Options > Advanced > General'''''.<BR>
    Look for and turn off '''Use Hardware Acceleration'''.<BR>
    Then check ALL of your settings. Browser and add-ons. Then restart.

  • Open an HTML file from a SAP Report

    Hi all!
    I would like to open an HTML file, that`s in a local directory of my PC, from a SAP Report.
    It is an alv list, where I have added a pushbotton. And I would like to code the utility of open a local html file, when someone push it.
    Anybody knows if it is possible?
    Thx

    Here is some sample code.
    report zrich_0002.
    call method cl_gui_frontend_services=>execute
      EXPORTING
        DOCUMENT               = 'C:test.html'
    *    APPLICATION            =
    *    PARAMETER              =
    *    DEFAULT_DIRECTORY      =
    *    MAXIMIZED              =
    *    MINIMIZED              =
    *    SYNCHRONOUS            =
    *  EXCEPTIONS
    *    CNTL_ERROR             = 1
    *    ERROR_NO_GUI           = 2
    *    BAD_PARAMETER          = 3
    *    FILE_NOT_FOUND         = 4
    *    PATH_NOT_FOUND         = 5
    *    FILE_EXTENSION_UNKNOWN = 6
    *    ERROR_EXECUTE_FAILED   = 7
    *    others                 = 8
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Please remember to award points accordingly and mark this post as solved when you problem is solved.  Thanks.
    Also, Welcome to SDN!!
    Regards,
    Rich Heilman

  • Write HTML Files from java application

    Hello,
    i have to write HTML files from a java application.
    I am asking if anybody can give me a hint about a good simple solution (library) which can do some of the job for me.
    i know FOP for example is good to create pdf or html from xml, but i dont want to go via xml.
    the sites i need are really very simple presents emails.
    body and maybe a link for next and pervious.
    however, thank you in advance.
    a little hint will also help :)
    Sako.

    That, too, is my question.
    Be the "server" local or remote, wouldn't JSPs still
    be the easier solution? No. it will not. because you need a server. Server for a stand alone application is not esier. according to who said JSPs are easy?
    Its very very difficult.
    >
    When answering, please clarify. I'm a bit of a newbie
    here. :)To get sence about how hard is JSP, check Struts. this is very good open source Framework to simplify the JSPs. but it still complecated enough.
    or Tapestry my lovely open srouce Framework.
    its easier than Struts. but sill complecated because of the documentation.
    All in all, using JSP is the purpose of Java in the internet. but not for me. My application will not be available in the internet, i.e. no server, i.e. no need for JSP.
    i hope that helps a little.

  • Kindly help me how to view html file in swing using jbutton

    hello..im a begginer at j2se language and im working on my school project..kindly help me how to view html files by clicking button at javax.swing..thanks

    Here you go:public class HTMLViewer implements Runnable, ActionListener
         public void run() {
              JFrame frame = new JFrame("View HTML");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JButton button = new JButton("Click me!");
              button.addActionListener(this);
              Container cp = frame.getContentPane();
              cp.add(button, BorderLayout.CENTER);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              if (Desktop.isDesktopSupported()) {
                   Desktop d = Desktop.getDesktop();
                   try {
                        d.browse(new URI("www.google.com"));
                   } catch (IOException ex) {
                        ex.printStackTrace();
                   } catch (URISyntaxException ex) {
                        ex.printStackTrace();
         public static void main(String[] args) {
              EventQueue.invokeLater(new HTMLViewer());
    }If that's not what you're looking for you need to ask more specific questions.

  • How to open a html file from hard disk

    Hello everyone,
    i want to display a html file by using java applet.
    This is my current coding:
    package mkbe.pg;
    import java.net.*;
    import java.applet.*;
    public class HtmlReader extends Applet 
    URL userUrl;
    public void start()
    try{
    userUrl = new URL(getDocumentBase(),"FILE:///c://2007/index.htm");
    }catch(MalformedURLException error){
    System.out.println("Error");
    getAppletContext().showDocument(userUrl,"_blank");
    }the program have no error and warning and the applet did run by appletviewer but the html file did'nt open.
    Is it there's mistake in my coding?
    If there is please tell me how to repair it.
    Thanks

    For an applet to read from a client's harddrive it will need permission.
    This can be done by putting the applet in a jar file and signing it,
    or by using the poiclytool to change the java.policy file to give FilePermission.

  • Dreamweaver cc 2014.1 will not open the html files from my business catalyst site

    I just imported my business catalyst site (originally built with Muse) into dreamweaver.  the whole site downloaded as expected and dreamweaver maintains that the 2 folders have the same files.  When I click to open any file in Dreamweaver it appears to open and then close the file immediately giving no indication of a problem. 
    Anyone come across this and or have any idea what could be happening?  I can open these files in Text Wrangler.
    I have followed the steps of deleting preferences etc that I have come across in my search today.  None of those helped. 
    Files from other sites seem to be opening fine.
    Thank you.

    The only files I am encountering this issue with are the ones I downloaded from BC into a brand new folder.  Further, any new files that I create in Dreamweaver and then save to the local root folder of the site I downloaded from BC will no longer open after I close them.  I can open all of the files I downloaded from BC in text wrangler with no problem.  I have about 10 other sites I am having no issues with what so ever.
    I am considering this an isolated issue between Dreamweaver and the folder that I imported my BC site to as I have never had any other issue with using Dreamweaver. 
    But to answer your questions:
    1.  no
    2.  no issue
    3.  yes, no issue.
    4.  yes.  all of them.
    5.  not doing this one. 

  • How do I open an HTML file from my hard drive?

    Hello FireFox,
    I develop applications in JavaScript and need to test them in the three major
    browsers including FireFox. In the older version one would click on the FireFox logo and
    go to New Page (New Tab?) and then File. Recently downloaded FireFox 30.0 and there
    does not seem to be New Page option. I see New Window but it does not give me an option
    for opening a file from the hard drive.
    Thanks
    Allen in Dallas

    Hi!
    There are a few ways to open files in Firefox. The easiest is '''CTRL''' + '''O'''. Another easy option is to click Menu > Open File (if it's not there, you'll have to enter the Customize menu to drag it in).
    <hr>
    Happy coding!

  • When I open an html file from the desktop all I see is source code rather than webpage.

    I have tried clearing the cache and reading other questions similar. I have a mac and am opening these files from the desktop, not a server or anything so It's incredibly annoying that firefox wont open them as html files even though that is what they are saved as. Also there is no .txt after them. They are purely .html files.

    Try to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
    *http://kb.mozillazine.org/mimeTypes.rdf
    *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions
    Firefox 16.0.2 is the last version that works on an Intel Mac with the OS X 10.5 operating system.
    * https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/16.0.2/mac/
    Another option to consider is to install the last Firefox 10.0.x ESR version as that version is more recent than the Firefox 16.0.2 version.
    * https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/10.0.12esr/

  • How to open an PDF file from Java Application

    Hi
    I am developing a GUI application in java swing.
    on clicking one button, I want to open PDF file from my swing application.
    Is there any API through which I can achieve this?
    Tapan Maru
    Sun Certified Java Programmer

    Here's a way to do it (if I understand you
    correctly). Just let explorer.exe do it for you.
    import java.awt.*;
    public class openPDF
         Desktop desktop = Desktop.getDesktop();
         public openPDF()
              open("test.pdf");
         public void open(String path)
              try
                   Runtime.getRuntime().exec("explorer.exe "+path);
    } catch(Exception e) { System.out.println("NAI!
    I! ERROR!\n"+e); }
         public static void main(String[] args)
              openPDF myApplication = new openPDF();
    Why do you have a Desktop object as a member but instead of using it, you execute a command with Runtime (which is not platform independent!)???
    -Puce

  • Help needed to load a flash file from another flash file

    This is a two part question - but I am sure that answering
    one will solve the other.
    I have a menu.swf file, and if I click on the top button it
    should load module1.swf. (Which it does) - however I can see the
    menu.swf file underneath the module1.swf file.
    The second part of the problem is that when I click on the
    top button of menu.swf, I want it to goto a specific location
    within module1.swf ( say the 8th page )
    If I use loadmovienum ("module1.swf",0) it opens a new window
    - instead of replacing menu.swf
    any ideas

    Use loadMovie() or loadClip (with the MovieClipLoader class)
    depending on how much you want to know about/control the load. With
    these you can specify a target movieClip for the load.
    Not sure what you mean by 'location'. If you're talking
    frames, you can use the load's target movieclip as a reference to
    the swf and use gotoAndPlay - but you have to make sure the swf is
    loaded first.

  • Can i open a flase file from java application?

    i want that when the user click a button on my java application,
    a flash file i made (Not html)will be showen .

    is it an executable(*.exe?), if it is then you could try using runtime.exec() to run it, but it would not be in a window that you created

  • Opening a .txt file from an application

    I have an application that extends JFrame. There is a JButton that I want to use to open a file called
    "Instructions.txt."
    and the path to the file is
    "E:\CM0112\Code\Instructions.txt".
    I want to open this file using TextPad, I have tried the code
    Runtime.getRuntime.().exec()but I keep getting compile errors. Any hints would be greatly appreciated.

    try this code
    public class Open
      public static void main(String[] args)
         String line;
         EasyReader inFile = new EasyReader("instructions.txt")
         if(inFile.bad())
            System.out.println(" *** Can't Open instructions.txt *** ");
            System.exit(1);
         while((line = inFile.readLine()) != null)
           //implement your own code, each time loop executes
           //line is the next line in the file until it is null.
      Go to www.rfrank.net/cs-labs/1400-tasmania/EasyReader.java to find EasyReader.java

  • Execute html file from java code - urgent!!!

    Hi,
    I need help!!
    My application should open html file that located in my computer
    it should be open when some line in JList was choosen
    my question is: How can I open html file from my application
    I work with window XP
    I tried this one :
    Runtime.getRuntime().exec(cmdLine);
    but it doesn't work
    the exeption was: CreateProccess
    Please help! it's urgent!!!!

    http://forum.java.sun.com/thread.jsp?forum=31&thread=497600

Maybe you are looking for

  • [SOLVED] netctl transition not working for me

    Hi, Following the latest news I tried to switch from netcfg to netctl but can't get it to work.. my netctl profile, similar to my netcfg one: Description='A simple WPA encrypted wireless connection using a static IP' Interface=wlan0 Connection=wirele

  • How to generate conc_request_id?

    Hi friends, Apps R12. I want to call a package from my PL code that normally is called from a Concurrent... It needs FND_GLOBAL.conc_request_id so.. is there any method to generate a concurrent_request_id whithout exectuing a request? I suppose there

  • Question - Oracle Physical Standby

    Oracle 10.2.0.3 database running on row logical disk (row device) with two thread RAC cluster with CRS and AIX-HACMP implemented on two nodes running AIX6.1 OS My question can one create simple Oracle Physical Standby (without data guard etc) Databas

  • Not enough money in Credit Card Account

    There was not enough money in my account when creative cloud tried to debit my credit card - how can i rectify this and make a payment - email advising me of this  problem has gone missing

  • My replacement iphone 4 has been block

    do anyone know how to complain to apple store? I have go the iphone 4 replacement year ago and now it is block by o2 I have contact to o2, they say it is blcok by previous user. I have been to apple store ask them to fix this for me.. apple store say