Web Browser and javascript

Hi, i've been looking for a solution to my problem in last 2days but i still can't find one.
I'm able to display a html page properly by using a JEdtiorPane and the setPage(URL url) method but still, neither javascript nor java applets run.
I get the raw code of html displayed but no interpretation of it.
Is there any way to execute it???
Here is the code :
import java.awt.*;
import java.net.*;
import javax.swing.*;
import javax.swing.event.*;
import java.beans.*;
* <p>Titre : Coffee Cup Browser</p>
* <p>Description : A browser written in Java</p>
* <p>Copyright : AirChtit Copyright (c) 2004</p>
* @author AirChtit
* @version 0.1.0
public class Connexion
    extends JPanel {
  private JEditorPane jep;
  private int type, num, var;
  private URL url, historique[];
  Connexion() {}
  Connexion(String urlString) {
    super();
    historique = new URL[20];
    num = 0;
    jep = new JEditorPane();
    openURL(urlString);
    jep.setEditable(false);
    jep.addPropertyChangeListener(new PageChangeListener());
    jep.setContentType("text/html");
    setBackground(Color.white);
    jep.addHyperlinkListener(new LinkActivator());
    add(jep);
  //M�thode d'ouverture de l'url ou de modification de l'url pour ouverture
  protected void openURL(String urlString) {
    try {
      url = new URL(urlString);
      jep.setPage(url);
    catch (Exception e1) {  }
}I don't want to use external component such as ie or netscape as can be seen in other post.
Hot java does it but i can't find how.
Sure u guys can do it.
Thx

Ah, but then how can you consider using JEditorPane, or URL or String, or any other pre-made classes? ;-) Usable web browsers are very very complicated, not something an inexperienced programmer can write on his/her own in one afternoon.
For executing JavaScript you need a JavaScript interpreter. I know of one called Rhino but I don't know how easy it will be interfacing it and the DOM model of the web page: http://www.mozilla.org/rhino/
For executing Java applets you need to first install a security manager that restricts the applet to a sand box. Then you load the applet class dynamically, instantiate it, and set its AppletContext (you must implement the AppletContext interface to do this). I know this is a bit vague but it will be clearer once you start working on it.
http://java.sun.com/j2se/1.4/docs/api/java/applet/AppletContext.html

Similar Messages

  • Closing the browser windows created by web.show_document and javascript

    From Forms I am issuing a http request using web.show_document and javascript:window.open(). The http request makes a remote procedure call to a coldfusion component on a JRun appserver. I want this rpc to fire in the background so that the current forms browser window remains as is.
    The logic is as follows
    l_rpcURL := 'http://....just a standard URL.....'; -- edited for this thread
    l_jsURL := 'javascript:window.open("' || l_rpcURL || '","","fullscreen=no,titlebar=no,location=no,toolbar=no,menubar=no,status=no,resizable=no");self.close();';
    WEB.SHOW_DOCUMENT (l_jsURL,'_blank');
    The http request works fine but leaves a browser window behind. It's the one created by the javascript.window.open(). If I remove the self.close() from the javascript then I have two browser windows open, one from web.show_document and the other, as described previously, from the window.open().
    Any idea how I can force closure of the window opened by the window.open() ?
    Thanks

    Hi,
    did this occured afer installing service pack 2?
    A work around is The only solution that is to create a close.html file and calling this file in the code: Web.show_document('http://server:port/close.html','_self');
    <html>
    <body onload="closeit()">
    <script>
    window.close();
    </script>
    </body>
    </html>
    Monica

  • Isolated: WEP is messing up my web browsing and uploads. Why?

    My web browsing and uploads keep "hanging" when accessing my AP Extreme wirelessly.
    A straight HTML downloads fine. But a page that has code that talks back to the server (e.g. a Google docs page) hangs. Also it seems that javascript navigation that sends info back up to the server also hangs.
    I just discovered after resetting my base station, this only happens when I use WEP encryption.
    I don't want to leave my network open. How do I fix this?

    If you search you'll find lots of complaints about this very problem. I'm not sure that a single, specific solution was ever reported.
    I suffered from this problem also. To me it seemed to be related to the fact that I had the "Create closed network" option selected.
    It also seemed that I had to make sure I entered the IP address of my router, but in my case that is because the AEBNs are not providing my DHCP service - my DSL router is.
    There is also an Airport Extreme update out on Apple's web site that may help.
    Whatever the problem(s), in my case turning off "Create closed network" and entering my router's IP address in the AEBN configuration seemed to solve the issue.
    And, by the way, it was Google that I was having a problem with, and Google that everyone else was having a problem with!
    Good luck.

  • I use Outlook for my email on the Safari web browser, and about 90% of the time when I want to attach a pdf or jpg file the email message will crash.

    I use Outlook for my email on the Safari web browser, and about 90% of the time when I want to attach a pdf or jpg file it fails and about 50% of the time when I want to send a standard text massage it will also fail and the email massage crashes. The only way I can get my Outlook to work is if I switch to Firefox web browser. I would rather not switch to a new web browser if I don't have to.
    It seems like what ever the problem is that its related the Safari web browser, because it works fine on the Firefox web browser.
    I think its some kind of plug-in failure because it giving me a LOC ERROR:
    LOC ERROR: Unable to locate localized string for resource ID 5007.
    How can I fix this Plug-in?
    And, yes my softwer is conpletly updated…

    That's an Outlook issue. You'll probably get better responses posting on the Office for Mac forums.

  • Acrobat plug-in. I get this when try to opem. The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser. Please exit Adobe Acrobat/Reader and exit your Web Browser and try again. Don't problems w/ Internet Explorer-

    Acrobat plug-in.
    The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser.
    Please exit Adobe Acrobat/Reader and exit your Web Browser and try again.

    See if you can find a NPPDF32.DLL files in the Firefox program folder (C:\Program Files\Mozilla Firefox\)
    You can see the installed plugins on the about:plugins page.
    * http://kb.mozillazine.org/about%3Aplugins
    You can set the pref plugin.expose_full_path to true on the about:config page to see the full path of plugins on the about:plugins page.
    It is best not to leave that pref set to true as it exposes that full path to web servers, so reset that pref to false after you are done with the about:plugins page.
    You can open about:plugins and about:config via the location bar, like you open a website (about: is a special protocol to access some build-in pages).
    If you get a warning when opening the about:config page then you can confirm that you want to continue.
    See Manually uninstalling a plugin:
    * https://support.mozilla.com/kb/Troubleshooting+plugins

  • Why do I receive this message? The Adobe Acrobat Reader that is running cannot be used to view PDF files in a browser. Please exit Adobe Acrobat Reader and your web browser and try again.

    The Adobe Acrobat Reader that is running cannot be used to view PDF files in a browser. Please exit Adobe Acrobat Reader and your web browser and try again.
    == This happened ==
    A few times a week
    == Early this year

    See these KB articles:
    https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox
    https://support.mozilla.com/en-US/kb/Opening+PDF+files+within+Firefox

  • The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser. Please exit Adobe Acrobat/Reader and exit your Web Browser and try again.OK. I followed the instruction and the problem still persists.

    I got the following pop-up when I tried to open an online PDF file:
    The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser.
    Please exit Adobe Acrobat/Reader and exit your Web Browser and try again.
    I tried many time, and it really doesn't work.
    The plug-in I have is Adobe Acrobat 8.3.0.280

    After I upgraded to Firefox 5, I had the same problem and I did a work around temporarily. I went the tools menu, then Add-ons, then clicked the "Plugins" on the left side (4th one down). I "disabled" both Adobe Acrobat 8.3.0.280 and Adobe Acrobat 10.1.0.536 using the disable buttons on the right side. PDF files now open again. However they are outside the actual browser.
    My guess is that Adobe didn't catch up yet with a new update to work with Firefox or vice versa.
    Hope that helps!
    Michael

  • When I open a new tab, an unwanted website opens instead of my desired home page. THIS IS ONLY AN ISSUE WITH NEW TABS; (opening the web browser AND clicking on the home button frings me to my desired home page.)

    When I open a new tab, an unwanted website opens instead of my desired home page. THIS IS ONLY AN ISSUE WITH NEW TABS; (opening the web browser AND clicking on the home button frings me to my desired home page.)
    I have attached the url of the unwanted site.

    Use this add-on [https://addons.mozilla.org/en-US/firefox/addon/custom-new-tab/ '''Custom new tab'''].

  • Disabling web browsing and Wifi Itunes music store

    We're thinking of getting a iPod touch for the kids for xmas and I'm wondering if there is a way to disable web browsing and iTunes wifi access, since I understand there are no parental controls available on the touch. Thanks

    yes there is no way to disable this icons, and the only way to do this is to put a password on your wireless router settings, this way they don't know the password and that they can not access the safari, youtube, and the wi-fi itunes music store.

  • Web browser and main screen links

    Ipad and iphone in your web browser and select the Add button on the main screen links you'd records. But after a while interfering links and previous links always returning to the same links. Waiting for your help.
    Best wishes

    Hello Kerim Koral,
    It sounds like you are saving webpages to your home screen, and they seem to be changing unexpectedly. I recommend closing all the running apps first:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    When you have done that and restart the phone and test the issue again:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Can I use Safari as my main web browser and Firefox when Safari isn't supported?

    Can I use Safari as my main web browser and Firefox when Safari isn't supported?

    www.apple.com/support/safari
    Also use the User Agent and see if that works on those sitess.
    Safari keeps a lot of web history and cache on disk and it tends to be RAM hungry (even FF has gotten a big larger on RAM footprint)
    There are other browsers and sometimes Opea is a good choice or there is OmniWeb which I still after 10 yrs? still favor.

  • Difference between JVM  of web browser and  JVM of webcontainer?

    hi friends , I am babu pursuing mca final year
    i have one doubt that is ........
    What is the difference between JVM of web browser and JVM of web container ?
    plz clarify my doubt

    Who said there's a difference?
    (By "web container" I assume you're talking about a servlet container or JSP container like tomcat.)

  • Web browser and script activeX controls and HTML data

    Hello,
    I'm trying to use the Microsoft Web Browser (IWebBrowser2) and Script (IScriptControl) activeX controls in Labview to evaluate and execute HTML script.  If I wire the web browser control's document object to the object input of the Script control's AddObject method, I can then evaluate/execute script such as "document.f.btnI.focus();" and such (in this case corresponding to Google's home page).  However, there are other expressions that include the "window" object that are proving much more difficult to work with.  Although I can browse the document object's parentWindow object via the property browser, if I try to access that object programatically, I get the error "Error -2147467262 occurred at No such interface supported".  I'm wondering how to include the window object for scripting.
    I'm writing a content-oriented web crawler.  I've been writing it with pretty low level TCP functions, handling 301/302 "object moved" and "<META HTTP-EQUIV="refresh" CONTENT="0; url=http://millercountyliberal.com/">" redirections manually.  But there are other automatic script-based redirections like:
    <script language="JavaScript" type="text/javascript">
    <!-- window.location="http://www.jrnl.com" -->
    </script>
    that I'm still trying to figure out how to work with.  As you can see, to work with that one manually involves the window object.  The reason that I don't just let the Web Browser object handle the redirections is because that object often throws script errors, downloads embedded graphics and other unnecessary components, can't handle some non-standard redirections, and sometimes annoyingly crashes.  Any help would be appreciated.  A code sample is attached.  The Web Browser control should already exist on your machine if you have Internet Explorer installed.  The script control may need to be registered before it can be used as follows:
    regsvr32 "c:\MyDir\XHTTP.dll"
    Thanks.
    Attachments:
    HTML Script Testing.zip ‏773 KB

    Hi Ted,
    This seems to be a problem with the way you are referencing the ActiveX properties.  I would research a little more on the API for these objects.  See http://msdn.microsoft.com/workshop/browser/webbrow​ser/reference/ifaces/iwebbrowser2/document.asp for an explanation of the IWebBrowser2 Document property.  I am suspicious of where you are typecasting the Document variant into the IHTMLDocument2 object and this is where the error is being thrown.
    A search of this error code on Google shows that this is a generic error from the ActiveX object, and not a LabVIEW error, although it is confusing since LabVIEW uses error codes in this same range.
    Hope this helps!
    Doug M
    Applications Engineer
    National Instruments
    For those unfamiliar with NBC's The Office, my icon is NOT a picture of me

  • Open 2 Web Browser and play a .swf File within each

    Hello,
    we are trying to implement a Screen Recording Functionality
    under Linux.
    The Recording will be done by vnc2swf. Then we have a .swf
    File with the Video.
    Now I want to play Back the recording within a Web Browser.
    That's shoudnt be the problem till now. But the difficult
    thing is that we have 2 Monitors connected to the Linux PC with
    their own display connection, therefore we get 2 .swf File each for
    each Screen.
    No I want to play back these two .swf Files each in one Web
    Browser on each Screen.
    Is this possible by programming this with Action Script 2/3 ?
    Thanks Richard

    When I go here, I can see the slide show fine.
    http://www.lvpaiutetribe.com/golf/home_slideshow.swf
    What's the url to the problem page?
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "GrayFox32" <[email protected]> wrote in
    message
    news:g1n9rc$t99$[email protected]..
    > I have a swf file that i want to apply to my website, i
    have done it
    before but
    > for some reason it doesnt want to work for this page.
    When i open the page
    > locally it plays the movie file but when i view my
    website online i cant
    see
    > the flash movie. The file is on my web host server and
    its mapped directly
    to
    > the file but it still doesnt work.
    >
    > Please Help, Thank You.
    >
    > <script type="text/javascript">
    > AC_FL_RunContent(
    >
    'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.
    cab#
    >
    version=9,0,28,0','width','612','height','284','title','home_slideshow','src
    ','h
    >
    ttp://www.lvpaiutetribe.com/golf/home_slideshow','quality','high','pluginspa
    ge',
    >
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=Shockw
    aveF
    > lash','movie','
    http://www.lvpaiutetribe.com/golf/home_slideshow'
    ); //end
    AC
    > code
    > </script><noscript><object
    > classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    >
    codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
    b#ve
    > rsion=9,0,28,0" width="612" height="284"
    title="home_slideshow">
    > <param name="movie"
    > value="
    http://www.lvpaiutetribe.com/golf/home_slideshow.swf">
    > <param name="quality" value="high">
    > <embed
    > src="
    http://www.lvpaiutetribe.com/golf/home_slideshow.swf"
    quality="high"
    >
    pluginspage="
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Ve
    rsio
    > n=ShockwaveFlash" type="application/x-shockwave-flash"
    width="612"
    > height="284"></embed>
    > </object></noscript>
    >

  • I recently purchased an older model computer with Microsoft Me from 2000. It doesn't have a web browser and I would like to download Firefox. Where do I find the download compatible with Windows Me and how do I download it?

    I have looked in your web site product downloads and I am unable to find a web browser download that is compatible with Windows Me from 2000. What am I missing? Is there a web browser download that is even compatible? It is just a second computer for my grandsons to use and do homework on, but I am unable to get up the internet.

    Firefox 2.0.0.20 is the last ever version of Firefox for Win98 / SE / ME.
    Get it from here:
    ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/en-US/

Maybe you are looking for