Results 1 to 3 of 3
  1. #1
    dhazwa is offline Member
    Join Date
    Jul 2011
    Posts
    15
    Rep Power
    0

    Angry opening an html file in default browser problems

    Hi,

    I am writing a program which has a part that needs to open up an html file, which runs some javascript. When I originally created the html file and opened it with IE9, a little message popped up at the bottom which said that any script and activex had been disabled. After doing some searching, I found that if you past the comment "<!-- saved from url=(0014)about:internet -->" ,which is called a "mark of the web", in the html code, before the <html> tag, it would stop the disabling of javascript. The comment worked great, but only when I manually clicked on the file (which is sitting on my desktop) or opened it up and ran it with Microsoft Expression. But when I tell my program to open that same file, the message about the javascript and activex comes back. I have tried many methods of opening the file including Runtime and java.awt.Desktop and several different variations of each (which did open the file, but with that damn message). I even did a Runtime where I just opened the iexplore.exe file with the arguments of the file location added. What makes this even more frustrating is that sometimes it WOULD work, with nothing different about the code!?!?! One thing that I am certain about is that when I run the same code in two different programs, it has different results. I usually make a side program to perfect the code of whatever part of my full program I am currently working on, and when I just have the code to open the html file open, it works great with no activex message. But when I copy that same code into my full program(the copied code does not rely on any other part of the full code, it is just the next step in a progression of things to be executed) the message about the activex comes back. Lastly, (things just keep getting weirder) I tried commenting out parts of my full program to see what was effecting the result, and it was the wierdest stuff. I found that if I have a Robot robot = new Robot(); anywhere in the program(before or after the part that opens the html file), the activex message comes back, and if I have a JOptionPane.showMessageDialog before the part of the program that opens the html file, the activex message comes back. At one point, as long as I opened up a browser with an http:// address first, the .html file on my computer would work without the activex message, but then all of a sudden that stopped working. Im not sure what all this means, but if someone could help out I might actually be able to keep some hair on my head.

    Thanks in advance!

    (P.S. sorry this was so long, I just wanted to give as much detail as possible.)

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,788
    Rep Power
    7

    Default

    Is your Java app trying to display the html or is it trying to launch a browser to display the html?

    Also, paragraphs!

  3. #3
    dhazwa is offline Member
    Join Date
    Jul 2011
    Posts
    15
    Rep Power
    0

    Default

    it is launching the default browser to show the html file (the reason is i am using the default browser is because after it opens the .html file, the javascript redirects the page, and from then on the user needs to use their default browser normally). Sorry about the paragraphs, I have been working on this problem for the last 48 hours without much sleep.... lol.

Similar Threads

  1. Replies: 5
    Last Post: 07-20-2011, 06:59 PM
  2. Opening .html file
    By Prajin in forum New To Java
    Replies: 7
    Last Post: 08-06-2010, 07:20 AM
  3. opening default browser window in invisible mode
    By robby14 in forum Advanced Java
    Replies: 1
    Last Post: 02-20-2010, 01:50 AM
  4. Replies: 4
    Last Post: 10-07-2009, 09:14 AM
  5. Opening applet with .html file
    By Atriamax in forum New To Java
    Replies: 12
    Last Post: 09-13-2009, 06:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •