Viewing HTML file

i don't know how to view an html file, is there a command that let me call the explorer and load the file ?
or is there a container or a class that shows html files ?
thanks

Creating HTML through Microsoft Word is not a good idea, it has to create the worst HTML I have ever seen. However to get your links working you will need to write a hyperlink listener. Theres an example in the javaDoc for JEditorPane http://java.sun.com/j2se/1.4.1/docs/api/javax/swing/JEditorPane.html

Similar Messages

  • Viewing html files in a folder...

    Hi...
    Anyone know how to view html files in a folder(s). What i mean is have them display as thumbnails, etc, so one can identify them visually rather than just by name? Abit like Bridge displays image files and even .psd and .ai files....
    Cheers,
    JJ

    martcol wrote:
    I was interested in this and had a Google around.  It struck me that you can get stand alone file viewers and I thought there must be one for HTML?  I came accross this: http://www.anixsoft.com/htmlview.html
    Absolutely no idea what it might be like but I'm willing to give it a try at the weekend.  Maybe there are others out there?
    Martin
    Googled too... but found nothing interesting... except what seems an old hack from a Microsoft guy who had a registry fix. But the link was very old...
    Anyway, have downloaded the link you gave... thanks... it seems to work as a standalone... almost like an image viewer such as irfan or Xnview...
    Cheers,
    JJ

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

  • URGENT : Viewing HTML files & UNICODE characters

    I do not know how to view HTML files in Java2. I have various HTML files which I would just like to display in the ContentPane of a Dialog Box.
    Please let me know how should I do it.
    Also, I have another question. How do I display Unicode characters like the alpha and the beta even after I know their hexadecimal values? I would like to display them as text on a JLabel. But the intended character doesnt appear. Instead, what appears is a black empty square in its place. Please let me know how to rectify this.

    You can use JEditorPane to display HTML file.You can dislpay alpha and the beta characters by
    jlabel.setText("\u03B1\u03B2");
    where 03B1 is unicode value for alpha and 03B2 is unicode value for beta.
    You can get unicodes for Greek from following link.
    http://www.unicode.org/charts/PDF/U0370.pdf

  • Setup to view html files

    I am new to weblogic Is there a way to setup weblogic to view html files I have 8.1

    private void openURL(String url) {
              String osName = System.getProperty("os.name");
              final String errMsg = "Error attempting to launch web browser";
              try {
                   if (osName.startsWith("Mac OS")) {
                        Class fileMgr = Class.forName("com.apple.eio.FileManager");
                        Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
                        openURL.invoke(null, new Object[] {url});
                   else if (osName.startsWith("Windows"))
                        Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
                   else {
                        //assume Unix or Linux
                        String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
                        String browser = null;
                        for (int count = 0; count < browsers.length && browser == null; count++)
                             if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
                                  browser = browsers[count];
                        if (browser == null)
                             throw new Exception("Could not find web browser");
                        else
                             Runtime.getRuntime().exec(new String[] {browser, url});
              } catch (Exception e) {
                   JOptionPane.showMessageDialog(null, errMsg + ":\n" + e.getLocalizedMessage());
         }

  • Viewing HTML files and Overriding a portlet

    Dear reader:
    I need to view an HTML file in a portlet according to a specified parameter passed via URL address, can i use url.display_url or not, and how? and if not what should i use?
    and related to that how can i call a portlet (or a page published as portlet)to override an existing one (programatically)?
    thank you for your time.

    To bring in content from another url, I've used code similar to the following within a Dynamic Page portlet with alot of success...
    <html>
    <table>
    <tr><td>
    <iframe
    src="http://www.domain.com/blablabla" noresize hspace="0" vspace="0" frameborder="0"
    marginheight="0" marginwidth="0" width="620" height="400">
    </iframe>
    </td>
    </tr>
    </table>
    </html>

  • How to view html files

    Hi,
    i had created a frame with a button..now i need to execute a html file not inside the frame, but in a web browser on click of the button how to do....

    private void openURL(String url) {
              String osName = System.getProperty("os.name");
              final String errMsg = "Error attempting to launch web browser";
              try {
                   if (osName.startsWith("Mac OS")) {
                        Class fileMgr = Class.forName("com.apple.eio.FileManager");
                        Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
                        openURL.invoke(null, new Object[] {url});
                   else if (osName.startsWith("Windows"))
                        Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
                   else {
                        //assume Unix or Linux
                        String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
                        String browser = null;
                        for (int count = 0; count < browsers.length && browser == null; count++)
                             if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
                                  browser = browsers[count];
                        if (browser == null)
                             throw new Exception("Could not find web browser");
                        else
                             Runtime.getRuntime().exec(new String[] {browser, url});
              } catch (Exception e) {
                   JOptionPane.showMessageDialog(null, errMsg + ":\n" + e.getLocalizedMessage());
         }

  • View HTML file in MIDP 2.0

    Hi,
    Is anyone aware of a library available that can be used for rendering local HTML files in a MIDP 2.0 project?
    I read some places that Sun was going to release an xHTML library but all links go to dead ends.
    Any advice would be greatly appreciated.
    Jim

    Hello,
    We can read or scrap html file from your apps.
    Sun has provide some article on the same.
    http://developers.sun.com/techtopics/mobility/midp/ttips/scraping/index.html
    go throught the article and i hope this will give you a idea at present.

  • Web sharing - viewing html files from Mac to PC

    I am creating a website using QuarkXpress. Now I uploaded my html and image folder directly to my Site folder. My client has a PC, but cannot open the http address to view the page. Web sharing is on, also file sharing. What did I miss?? Thanks for your help.
    I highlighted websharing in system preferences and gave my client my computer address. But the page does not load?
    What's the difference from a remote computer and local IP range? I am confused there???

    Do you have more than one device connected to your Router or Modem?
    To see the difference between local & Remote, compare your IP in System Preferences>Network>TCP/IP tab & what your outside IP is...
    what's my ip...
    http://www.whatsmyip.org/

  • View HTML file in application server in MPP

    Hi,
    I have a html index file and a bunch of other files accessed by the index file in a specific directory on the SAP server. I would like to display the index file on click of button created in MPP.
    How to achieve this ? Any idea ?
    Thanks,
    K.Tharani.

    check the value of sy-subrc for open and close dataset statements so that you would know whether the file was opened and closed correctly.
    Regards,
    Sumit

  • View local html files

    Does anyone here know how to view html files which are stored locally on iPhone?
    Thanks

    Unfortunately, iPhone Safari doesn't support the "file://" protocol.
    Not having local storage of web apps was, and is, a big limitation.
    Some companies I contract to, have large business apps written under IE6 on handheld Windows CE devices. The apps are stored on the device. When the iPhone (and Safari Windows) came out, we thought about modifying them to run under Safari. The limitation stopped that idea.

  • Viewing Dreamweaver files in Word 2007

    When viewing html files from Dreamweaver CS4 in Word 2007 the text is right-shifted on the page. It displays fine in all previous versions of Word but not with 2007. I have tried the various advanced options, compatibility settings to no avail. I have tried resetting office back to factory settings (including the document templates) but it still doesn't work. I decided to post this here in case anyone has had a similar issue opening files from dreamweaver to Word 2007.
    Any help would be greatly appreciated.
    John

    I'm with Murray here.
    It's a recipe for disaster and you'll no doubt end up being asked to fix it.
    There are many better ways of allowing clients to edit websites without opening the site to wholesale destruction.

  • How can I edit an html file in Firefox using View Source?

    I have created an html webpage and saved it to my pc. I can't edit the html file in firefox when I right click on the page and select "View Source". I can view the code but I can't edit it. I can do this in IE9.
    I thought I was able to do this before in Firefox.
    Did my settings change somewhere that I can no longer do this?
    Do I have to have something checked in the Web Developer extensions for it to work?
    I'm using Firefox 24.0
    Thank you for any help with this. :)

    The View Source window in Firefox cannot be used to change computer codes. Nor can the Web Developer tools.
    Sorry for any inconvenience.
    I suggest using Programmer's Notepad.

  • DW CS5 - PHP in HTML file - no display in DW live view

    Have DW CS5, Local IIS 7 (Win 7 64x) testing server (Server Model: PHP MySQL) set up and working. External browsers render .html files with PHP fine (URL=http://localhost/testphp.html), DW Live View will not parse/display the PHP with ".html" extension. No ".htaccess" file, DW PHP Tag Library has all PHP "Used In:" boxes checked. Example:
    Example 1
    File name: testphp.php
    <html>
    <body>
    <h1>Hello There</h1>
    <script language="php">
    echo "Hello World";
    </script>
    </body>
    </html>
    DW Live View and external browser URL: http://localhost/testphp.php:
    Hello There
    Hello World
    Example 2
    File name: testphp.html (same content as above, just filename extension changed)
    <html>
    <body>
    <h1>Hello There</h1>
    <script language="php">
    echo "Hello World";
    </script>
    </body>
    </html>
    DW Live View:
    Hello There
    external browser URL: http://localhost/testphp.html:
    Hello There
    Hello World
    How to configure DW CS5 to display PHP in DW Live View with file extension= ".html"?
    Thanks in advance, have spent 2 days trying to accomplish!
    Steve

    File name: testphp.php 
    <html>
    <body>
    <h1>Hello There</h1>
    <script language="php">
    echo "Hello World";
    </script>
    </body>
    </html>
    This is not PHP code
    The red code part should read as to be classified as PHP script
    <?php echo "Hello World"; ?>
    File name: testphp.html (same content as above, just filename extension changed) 
    <html>
    <body>
    <h1>Hello There</h1>
    <script language="php">
    echo "Hello World";
    </script>
    </body>
    </html>
    Apart from the same mistake as above, this file will not be recognised as containing PHP without the PHP extension. You can setup the server to accept HTML and to interpret same as PHP, but I would not recommend this.
    DW Live View:
    Hello There
    external browser URL: http://localhost/testphp.html:
    Hello There
    This is amazing! With the code above? If you hadn't told me I would not have believed it. I tried it on my humble setup and you are correct. It works using the PHP file but not the HTML file. It doesn't matter, it is still not correct.
    How to configure DW CS5 to display PHP in DW Live View with file extension= ".html"?
    It is not up to DW to determine, it is the PHP server that determines whether PHP in an HTML file will be shown. Have a look here http://php.about.com/od/advancedphp/p/html_php.htm .Once again, I do not recommend this
    I hope this helps.
    Ben

  • How to display local HTML file in web-view?

    Hello everyone,
    we have no problem with showing of remote HTML content from server in box on page in web view. But how we can show such a content when included in HTMLResources? In guide is just "Display a local HTML file in an in-app browser", which works wihout problem, but we don't want to show this HTML content in in-app viewer, it should be part of page.
    Thanks
    Martin

    Now i'm confused. In guide is this:
    To use local HTML files, click the folder icon and specify the local HTML file. The HTML file (such as index.html) should appear in a folder that includes any images or scripts used in the HTML file.
    But no info where such a local HTML file should reside. If this file is in HTMLResources, it is ignored.

Maybe you are looking for