How to show a html page in a swing applet -- URGENT!!!

Hi All,
I'm trying to show a html page inside a swing applet... is it possible to do that?? if so is there any built-in classes available for that?? If anyone have some examples, plz help me with that....
Thanks,
Ragu

i havent tested.. but this should work. i am no expert on these either, just to give you an example.. :-)
JEditorPane ePane = new JEditorPane();
HTMLEditorKit html = new HTMLEditorKit();
ePane.setEditorKit(html);
HTMLDocument htmld = new HTMLDocument();
try{
URL url = new URL("http://hcs.harvard.edu/~undercon/");
InputStream ins = url.openStream();
ePane.setDocument(htmld);
html.read(ins,htmld, 0);
this.getContentPane().add(new JScrollPane(ePane),BorderLayout.CENTER);
catch(Exception e)
e.printStackTrace();
}

Similar Messages

  • How to show an html page using JEditorPane in applet.

    I have never use jeditorpane with applet so i dont know how to show a html page.if you have some code or any example then please posted that.Thanks

    public class MyApplet extends JApplet{
        private JTextPane textPane = null;
        public void init(){
        HTMLEditorKit editorKit = new HTMLEditorKit();
        HTMLDocument  htmlDoc   = (HTMLDocument)editorKit.createDefaultDocument();
        textPane  = new JTextPane();
        textPane.setEditable(false);
        textPane.setEditorKit(editorKit);
        textPane.setContentType("text/html");
        textPane.setDocument(htmlDoc);
        Container c = getContentPane();
        c.add(new JScrollPane(textPane),    BorderLayout.CENTER);
        c.add(buttonPanel,                  BorderLayout.SOUTH);
        c.add(Box.createVerticalStrut(5),   BorderLayout.NORTH);     
        c.add(Box.createHorizontalStrut(5), BorderLayout.EAST);     
        c.add(Box.createHorizontalStrut(5), BorderLayout.WEST);
        public void setHtml(String html){
            // you should check the textpane's document to detrmine if there
            // is already text in there..if so, then clear the textpane text and then
            // set the new html...Note: JTextPane only show basic Html ..
            // not like a full blown browser
            textPane.setTextt(html);
            textPane.setCaretPosition(0);
    }

  • How to show an HTML page in a new browser window

    Hi Everyone,
    I am trying to show a page generated by some servlet in a new browser window when the button is clicked on the applet. I can accomplish that by using AppletContext as in:
    myApplet.getAppletContext().showDocument(servletUrl, "_blank");
    The only problem with this is that I don't have any control over how the new browser window is displayed. Using JavaScript I can set size, hide toolbar and address bar, etc. But how can I hide address bar on a new browser window generated in this scenario?
    I tried to call intermediate servlet from my applet which in turn generates a new window by writing out JavaScript code. This way I lose my previous page with the applet even though a new window is displayed the way I wanted but I want this new browser window to act as a pop-up box and my applet page stay on screen. Also, is there a way to send a POST request from an applet by using AppletContext.showDocument() method?
    Any help will be greatly appreciated!
    Thanks in advance,
    Y.M.

    Did you ever figure out a solution for this? I too would like to open a new browser window to act as a pop-up box and my applet page stay on screen. If anyone has any thoughts on how to do this, please post! thanks.

  • How to create a html page

    Hello,i am very new to dreamweaver 8,and i have searched
    everwhere possible on how to create a html page.My website has a
    navegation bar.And on the navegation bar it has links,like
    forums,your accounts,and etc,but thats already integrated with the
    website.Now i have an option in the admin area,wher i can create a
    new category so that it would show up in the navegation bar,and i
    have a drop down menu where i cans select what to put in that
    category.But also i have an option to put a external url,so that
    when they click on it,it will take them to where that link is
    directed.The point is that i asnt to make a category in the
    navigation menu that says Lirics.So that i can put lirics of songs
    and etc,and that when users click on that link it will take them to
    the lirics page..Do you guys understand?Sorry for the bad english,i
    am now quite good with it..

    The most eloquent description will do nothing for us. To get
    a solution to
    your problem, we must see your code. Can you upload the file
    and post a
    link to it, please?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "don_playboy" <[email protected]> wrote in
    message
    news:eaadi9$kjf$[email protected]..
    > well what i am trying to say is that i created a Folder
    named
    > Liricas(which is
    > lirics in spanish),on my ftp.Now since i created that
    folder in my ftp,it
    > will
    > show on my navegation menu control panel.But it will be
    blank since it has
    > nothing on it.Now what i want to do is,sicne i created
    that folder,and i
    > go to
    > my nav meny control panel and select it as a category it
    will show on my
    > navegation menu(the Liricas that is),but when u click it
    it has
    > nothing,since
    > it has no html or anything in the category.Now i want to
    create a html
    > page so
    > that i can put albums names,and under those albums name
    i want to create a
    > link
    > or category thats for lirics.So all this will be stored
    on the ftp.and
    > when
    > users click on the Liricas category on my navigation
    menu,it will take
    > them to
    > the liricas index page,which will show all the lirics...
    >
    >
    >
    >

  • To show a html page from java application

    hi everyone,
    I am trying to show a html page through java application. What i tried is Runtime.getRuntime().exec("start url"); this shows it opens default browser. It works fine for win Nt but does not work on win98 or linux.
    Is there any other way of achieving the same?
    can anyone help me in this regard. I am in urgent need of it. any reply will appreciate.

    I hope this works.
    String urlName = "http://forum.java.sun.com";
    String browser = "iexplore "; //EXE file name --> for iexplore.exe
    Runtime.getRuntime().exec(browser+urlName);

  • How To Call HTML Page Through Java Swing Page  ???....

    Hi All ;
    Please Can You Tell Me How To Call HTML Page Through Java Swing Page ....
    Regards ;

    Hi,
    you can use HTML fragments on a panel.
    http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
    However, to integrate a browser you need 3rd party software like IceBrowser
    If you Google for: HTML Swing
    then you find many more hints
    Frank

  • How to create a HTML page like iView, thanks in advance!

    How to create a HTML page like iView, thanks in advance!
    I'm a newcomer, would you please tell me how to create a HTML page in WebDynpro ? In fact, i want create one welcome page which use html format and include some javascript.
    thanks again.

    jakinapallykrishna , thank you very much for you reply.
    The pdf file is a simple application, but i want know how create a view in HTML format (<HTML>... </HTML>), maybe use HTMLB control, i don't sure it.
    In fact, I need create a view in portal, some pictures in it, once mouse over one picture, it need change another picture replace old one. I don't know how to do it, just know it can be handled in HTML page. So, i need help.
    Thanks.

  • Oppening a html page from a swing applincation

    How to display a html page from a user interface developed in swing(specially via a JButton.
    please help me!!!!!!!!!

    look at
    developer.java.sun.com/developer/Books/ gui/swing2/swing2_chap20.pdf
    source :
    http://www.manning.com/sbe/files/swing2e/Chapter20.zip
    It's an simple HTML editor

  • Displaying html page with in the applet

    I want to open an html page in the applet. If i use showDocument() of applet, it opens the html page in the browser, but i want to open the html page with in the applet(i.e., applet should display the html page). Is there any way which i can do the above thing.
    Thanks in advance

    Look at this sample:
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    public class BrwsA extends JApplet
         JPanel      jpa = new JPanel();
         JEditorPane jed = new JEditorPane();
         JScrollPane jsp = new JScrollPane(jpa);
    public BrwsA()
         jpa.setLayout(new BorderLayout());
         jpa.add(jed);
         jpa.setPreferredSize(new Dimension(800,1000));
         jed.setEditable(false);
         jed.setContentType("text/html");
         jed.getEditorKit().createDefaultDocument();
         setContentPane(jsp);
    public void init()
         try
              URL url = new URL(getCodeBase(),"test.html");
              jed.setPage(url);
         catch(MalformedURLException e)
         catch(IOException e)
    }Noah

  • Opening html page with in the applet

    I want to open an html page in the applet. If i use showDocument() of applet, it opens the html page in the browser, but i want to open the html page with in the applet(i.e., applet should display the html page). Is there any way which i can do the above thing.
    Thanks in advance

    Use a JEditorPane to display HTML (supports version 3.2 though)
    check API (that's for JDK 1.4.1 so check for version you use)
    http://java.sun.com/j2se/1.4.1/docs/api/javax/swing/JEditorPane.html
    Sky

  • How to show  an error Page in Weblogic when the server is down

    Hi ,
    I heard that every container has the facility to show an error page when the server is down and (when the request has arrived at that time ).
    Please tell me how to configure this in BEA weblogic ??
    Thanks .

    Hi,
    From my understanding weblogic dose not provide the thing which you are asking for, reason is given below.
    - An application is deployed only on managed server one (MS-1)
    - Now if the request comes to the server (MS-1) when it was running and then for some reason MS-1 goes down then weblogic server would be able to send any response back to the client as its down.
    - Hence nothing can be done as the request object is been lost when the server goes down or even cant redirect to an error page as for doing that too the server has to be up and running.
    However there are other way round which can help you overcome this issue as shown below
    - Use Clusters with few managed servers in it which gives you high availability and load-balancing.
    - Use any web servers like Apache in front of weblogic servers.
    Using the above things you can also use customized HTTP Error Responses with error-page element in web.xml and create your own error pages which can be re-directed for the web server side also. For more information go through the below links
    Topic: Customizing HTTP Error Responses
    http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webapp/configurejsp.html#wp157884
    Topic: error-page
    http://download.oracle.com/docs/cd/E13222_01/wls/docs81/webapp/web_xml.html#1017571
    Topic: ErrorPage
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/plugins/plugin_params.html#wp1155425
    Hope above information helps you.
    Regards,
    Ravish

  • How to display static HTML pages in Oracle Forms 6i

    I want to display static HTML page in oracle Forms ? Can any body help please ? Its very urgent. Many thanks in advance.

    Suresh,
    there exist a Java Bean in teh Forms 6i demos that shows a static HTMl example. Note that the HTML that could be shown is somewhat basic, but it will give you an impression how it can work. The demos are at otn.oracle.com/products/forms --> samples --> 6i demos
    Frank

  • How to save a html page

    I'd like to know how to open and save a html page from a java code, specifying the url. I need to search a lot of pages and i'd like to do it automatically once i have generated the url.
    Thanks
    David

    Here's the tutorial about networking, it shows you how to read from a URL:
    http://java.sun.com/docs/books/tutorial/networking/index.html
    Here's the tutorial about how to do file I/O, if you didn't already know how:
    http://java.sun.com/docs/books/tutorial/essential/index.html

  • How to open an HTML page that is part of my project using Captivate 6

    I'm looking to create an HTML page that will use some javascript to extract information from Captivate and then render it to the browser window as a report.
    I see how you can Open a  URL webpage from Captivate (by putting in an explicit address ie www.abc.com   or http://www.abc.com/myReport.html)
    but I'm curious what address I can use if the html file is in the SAME folder at the index.html that launches the captivate project  (or perhaps one folder down)..    I'm wanting to do this so it works whether I've published the project to a webserver or not.
    I was thinking I could use a relative reference (ie  something like .\myReport.html), but I haven't had any luck thus far

    Thanks Seth.
    I just tried that, but when I run it in preview mode (by simply hitting F12), it gives me an error because it can't  find the file in the temporary preview folder it creates (ie:
    C:\Users\Tom\AppData\Local\Temp\CP2840464090993Session\CPTrustFolder2840464091009\Captivat ePreviewLoader\
    I'm hoping to find a place to put it so that it works when running F12 and when running in regular 'published' mode
    I was thinking I could put it in the 'C:\Program Files\Adobe\Adobe Captivate 6 (32 Bit)\Templates\Publish' folder, but when I do that, it doesn't seem to gete copied to the .\CaptivatePreviewLoader folder when running F12

  • How do You set -noverify in an HTML page that calls an applet

    I have an applet which runs fine from inside JBuilder when I specify a
    -noverify switch in the debugger. (java -noverify myapplet.class)
    Without this switch, I get a verification exception.
    So I need to specify the -noverify switch from inside a webpage so that when the client runs it, he does not get the same exception.
    The question is how do you pass -noverify to JVM from an HTML page that uses <applet> tag and javascript?
    Thanks

    Odd, because I work on an applet that gets built with 1.4. We have 30,000+ clients who use it every day, and I'm sure we don't tell them about setting -noverify switches in their plug-in control panel, and we don't (cuz we can't) set it in the applet (object/embed, actually) tag.
    Of course, I suppose it could be a backwards compatibility issue going from compiling in newer version than it's run in.

Maybe you are looking for

  • How do I get Adobe Professional 8 to work with Windows 7?

    I have a new computer with Windows 7 on it and when I try to install Adobe Professional 8 it says I need a Windows Vista Adobe PDF.dill file.  Where can I find this file?  I do not have Windows Vista.

  • Basic questions about JDK1.4.2 & Netbeans3.6

    Hi All, I am planning to install "j2eesdk-1_4-windows [103MB]" & "NetBeans3.6[38MB]" on my Windows machine. Please, advise me for the following questions. 1) What is the name and version of Application and Web Server which "j2eesdk-1_4-windows[103MB]

  • Logical & Physical Standby

    1) Is Logical Standby built up on Log Miner? 2) Is it not possible to use Logical Standby without turning on supplemental logging? 3) Is there any relationship between LGWR & LNS in Log Transport Mode?

  • Errors After Installation

    Hi. Recently I installed the Student version of Flash CS 5.5 on my laptop (Windows 7), but there had been some error reports. How should I fix these? I've tried using Adobe Support Advisor and re-installation after re-starting my laptop, but neither

  • Bridge CS2 to Bridge CS3

    With CS2 I was using bridge to adjust my RAW files. What happened to that ability in CS3? I can't figure out how to open a RAW file/files with Bridge any more. Now when I click on a RAW file I get this little window opening up that doesn't allow anyt