Exporting a String Array to an HTML file

Hey everyone..I'm currently making lots of progress in my project...but right now I've been trying to make a button that exports my search results to an html file...basically what I've made is a search engine to search webcrawler files...
The result list I get (which is actually a string array), I want to export to html so I can open that html file and find all the links that were found in the search I made..What I have so far is this, but it's not working yet, any help? :
    private class exportListener implements ActionListener
        public void actionPerformed(ActionEvent e)
            String[] result = parent.getResult();
            if(result == null)
                return;
            JFileChooser chooser = new JFileChooser();
            chooser.setAcceptAllFileFilterUsed(false);
            chooser.setFileFilter(new HtmlFileFilter());
            chooser.setDialogType(JFileChooser.SAVE_DIALOG);
            int returnVal = chooser.showSaveDialog(parent);
            if(returnVal == JFileChooser.CANCEL_OPTION)
                return;
            File fl = chooser.getSelectedFile();
            String path = fl.getPath() + ".html";
            searchIF.exportResultAsHtml(path);
            System.out.println(path);
    private class HtmlFileFilter extends FileFilter
        public String getDescription(){return "Html";}
        public boolean accept(File pathname)
            String name = pathname.getPath();
            //Just checking to see if the filename ends with html.
            if (name.toLowerCase().substring(name.lastIndexOf('.') + 1).equals("html"))
                return true;
            return false;
        }

Actually..nevermind, sorry.

Similar Messages

  • I imported my IE Favorites folders but they are empty. I also tried exporting my IE Favorites to a html file but still did not work.

    All of my folders came over but are empty. I also exported my IE Favorites to a html file and then imported them but they also came over empty and there are no favorite links shown that were not in folders. When I look at the html file, I can see all the links.

    You only get a "From Internet Explorer" bookmarks folder if you use the Import wizard (Import Data from Another Browser).<br />
    Otherwise the bookmarks should just be appended at the end of the Bookmarks Menu folder.
    It is possible that the file path is too deeply nested if import isn't working.

  • Export bookmarks fails to produce an html file in the chosen location without an error message?

    I go through the steps from the bookmarks menu to export bookmarks to html.
    All goes well without an error message, but the file is not created in the selected location.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    * http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • I had to re-install firefox recently and lost all my bookmarks and passwords, how do I retrieve them? I have already saved them as an html file on my desktop.

    I've been having problems with my computer, and had to delete Firefox entirely several times. I don't believe it was your browser that was the problem, though now I have lost all my saved bookmarks. I did export them to IE as an HTML file, which I still have on my desktop. I am now in the painful process of remembering and resetting passwords that Firefox remembered when I had it originally installed (I am back at ground zero with the browser now).

    Please read this article about restoring bookmarks:
    http://kb.mozillazine.org/Lost_bookmarks
    As far as your passwords are concerned, I don't think there's anything you can do. But for the future, you can use the following add-ons to avoid any future loss:
    https://addons.mozilla.org/en-US/firefox/addon/2848/
    or
    http://www.xmarks.com/
    Both are good.
    And a simple way to import your bookmarks (since you already saved it on your desktop as html) is:
    Bookmarks / Organized Bookmarks / Import and Export
    Good luck.

  • How to create a small HTML-file in Applet

    What i wan't to do is as follows:
    1. In an applet i create a string containing a small HTML-file. Its contents depends on what the user chose in the applet.
    2. then i wan't to redirect the browser to that HTML-file. appletcontext.showDocument(URL) could be used.
    The problem is how can i create an URL to a string which is only in memory.
    Writing the string to a file and then creating URL to it poses problems, as we all know, writing files from applets is difficult.
    Any help would be appreciated.

    Here is how you do it:
    1) use the JSObject (you may have to import
    netscape.javascript.JSObject depending on the
    version of your SDK) to open a window with an empty
    URL, a title , and a _blank or _self
    target.
    2) use the JSObject document.write to write the HTML
    string to the window that you opened in #1 above
    3) close the document.
    If you need further assistance, post your code and I
    can modify it for you or if you want, I can whip up a
    small demo applet for you to try.
    ;o)
    V.V.Thanks!! Your post has been very helpful. One question though, I suppose the client has to have a java-plug-in installed in his/her web-browser, is that right?

  • Export data from iphoto 09 to searchable file

    I have iphoto 09.  I would like to export the titles, locations, times and dates, and comments for the photos in an album to a searchable file.  I can't find a simple way to do this.  Please help

    I have created a database of family photos.  I would like to merge the information I have stored in the database about each photo with the information from iphoto into a single set of files I can distribute to other family members.  iphoto lets me export the photos and ancillary information html files but I have no way to combine that with the other information stored in my database.
    I can export the information from the database to a tab delimited file which makes it accessible to all sorts of other applications.  I would like to be able to do the same thing with the iphoto data.
    Thanks.

  • I want to save a html file to server and then want to open it.

    Requirement: I'm having an applet which is having a button named letter. When a user clicks on the button, following should happen --> An event will occur which will read some data from backend system(mainframe) and will store that in a string variable. A html file is created using this data in the body part, and then it should open in a browser.
    My problem is how can I launch(open in a browser) this html file.
    1) Is it possible to launch this file without storing it on hard drive.
    2)To use Runtime.getRuntime.exec(cmd.exe /c start filepath) , I need to store this file somewhere. How can i store this on server?

    1) Can you please give me an example showing how i can use Jtextpane.For html, JEditorPane (instead of JTextPane is better)
    For examples, go through these tutorial trails:
    [http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html]
    [http://java.sun.com/docs/books/tutorial/uiswing/components/text.html]
    2)Also please tell me how to save the file on user's machineSee this trail:
    [http://java.sun.com/docs/books/tutorial/essential/io/index.html]
    and how can i delete the file from user's machine once it is closed by the user?Very simple, read the api docs: [http://java.sun.com/javase/6/docs/api/java/io/File.html#delete()]
    Thanks!

  • How do I transfer html files from adobe muse onto mediawiki?

    I used adobe muse to make a website, then exported it as a group of html files, but my end goal was to make a well-designed page on mediawiki. Please help and give details! I would very much appreciate it.

    Hi wikingsmith,
    Please check basic explanation here Php... Adobe Muse Compatible?? . further to this you can consult their converters that may help uploading them to Mediawiki Manual:Importing external content - MediaWiki
    Kind Regards,

  • Exporting to textile/html file

    Hi everyone..I'm sorta new to this java thing..been working on it for a year or so now..and right now im working on this little project where I search a web crawler file and return a string array of results into list in a GUI I made.
    What I basically want now is to export the result to a text file..preferrably a html file where I can then open the html file and then it'll have all the url links in it..so far I have this:
    private class exportListener implements ActionListener
            public void actionPerformed(ActionEvent e)
                String[] result = parent.getResult();
                if(result == null)
                    return;
                JFileChooser chooser = new JFileChooser();
                chooser.setAcceptAllFileFilterUsed(false);
                chooser.setFileFilter(new HtmlFileFilter());
                chooser.setDialogType(JFileChooser.SAVE_DIALOG);
                int returnVal = chooser.showSaveDialog(parent);
                if(returnVal == JFileChooser.CANCEL_OPTION)
                    return;
                File fl = chooser.getSelectedFile();
                String path = fl.getPath() + ".html";
                searchIF.exportResultAsHtml(path);
                System.out.println(path);
        private class HtmlFileFilter extends FileFilter
            public String getDescription(){return "Html";}
            public boolean accept(File pathname)
                String name = pathname.getPath();
                //Just checking to see if the filename ends with html.
                if (name.toLowerCase().substring(name.lastIndexOf('.') + 1).equals("html"))
                    return true;
                return false;
            }These are basically handling the whole process of preparing to export to html..and then I made a SearchHandler which is accessed through an interface, and I have a method that reads like this:
         public void exportResultAsHtml(String path)
        What I'd like some help/advice on..is how I should process it..ie. what should I put in this method to setup the result into a html file with body etc and such, so it comes out in the file something like this:
    www.something.com/index.html
    www.somethingelse.com/index.html
    www.somethingdifferent.com/index.html
    And so that they are links you can click and it'll send you to the clicked link.

    Here's a starter:
         private void exportAsHtml(final File target, final String[] links)
              throws IOException {
              if (target == null) {
                   throw new IllegalArgumentException("No output file specified.");
              FileOutputStream fileOut = null;
              try {
                   fileOut = new FileOutputStream(target);
                   PrintWriter writer =  new PrintWriter(fileOut);
                   writer.println("<html>");
                   writer.println("<head><h1>Web Crawler Links</hi></head>");
                   writer.println("<body><ul>");
                   if (links != null) {
                        for (int current = 0; current < links.length; current++) {
                             writer.println("<li><a href='" + links[current] + "'>" + links[current] + "</a></li>");
                   writer.println("</ul></body>");
                   writer.println("</html>");
                   writer.flush();
              finally {
                   if (fileOut != null) {
                        fileOut.close();
         }- Saish

  • Help needed  while exporting crystal reports to HTML file format using java

    Help needed  while exporting crystal reports to HTML file format using java api(not using crystalviewer).i want to download the
    html file of the report
    thanks

    the ReportExportFormat class does not have HTML format, it has got to be XML. Export to HTML is available from CR Designer only.
    Edited by: Aasavari Bhave on Jan 24, 2012 11:37 AM

  • How can I import my IE8 bookmarks/favorites into Safari if I only have access to the data stored on my old hard drive? I can't run Windows to export them to an html file.

    My old PC died and I replaced it with a MacBook Pro.  Although I was able to copy the data from the PC's hard drive, I am unable to export my previous bookmarks/favorites to an html file because that PC won't boot.  Is there any other way to import them into Safari using the raw data stored on that drive or convert them somehow to a format I can import?

    You can only use a JSON backup to restore all bookmarks in Firefox.<br />
    If you need to import Firefox bookmarks in Safari then you need to (re)install Firefox and export the bookmarks to an HTML file.
    *http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

  • URGENT-CREATE A HTML FILE WITH AN STRING INPUT FROM THE RUNNING JSP

    I am designing a web page where the user enters a page after entering his/her login and password.The User should now be provided with a display page containing the servers that he has permissions for access.The servers that he has permissions are maintained in a database(a normal text file in UNIX).
    Till now the program has been complete for displaying the servers that are available to him.
    I need to create a HTML form containing these servers names in a check box so that when the user clicks thcheck box against the server name it should go to the server and get the password for the required server.
    THe intention from me is to create a HTML file that dynamically takes values from the running JSP means the server names as a string value to its input and then i can continue
    Please guide me in creating a HTML form based on the string output from the running JSP
    FileInputStream fs = new FileInputStream("/root/Auth_Application/User_Access_List");
    DataInputStream in1 = new DataInputStream(fs);
    int fl=0;
    while (in1.available() !=0)
    String str1=in1.readLine();
    StringTokenizer st1 = new StringTokenizer(str1);
    String usernam=st1.nextToken();
    if (usernam.equals(uname))
    String ip=st1.nextToken();
    String host=st1.nextToken();
    fl=1;
    out.println("<tr><td>                                                                                              "+ host + "</td><td> " + ip +"</td></tr>");
    if (fl == 0)
    out.println("YOU HAVE NO SEVRER IN YOUR PROFILE !");
    in1.close();
    The host string here is the server name
    the ip is the ip address of the server
    Need to input these values to another HTML page that contains the check box list of the servers .
    once these are clicked i think i can pass on this to another JSP and retreive passwords
    Please guide me in this

    FileInputStream fs = new FileInputStream("/root/Auth_Application/User_Access_List");
                                    DataInputStream in1 = new DataInputStream(fs);
                                    int fl=0;
                                    while (in1.available() !=0)
                                    String str1=in1.readLine();
                                    StringTokenizer st1 = new StringTokenizer(str1);
                                    String usernam=st1.nextToken();
                                    if (usernam.equals(uname))
                                    String ip=st1.nextToken();
                                    String host=st1.nextToken();
                                    fl=1;
                                    out.println("<tr><td>                                                                                              "+ host + "</td><td>          " + ip +"</td></tr>");
                                    if (fl == 0)
                                    out.println("YOU HAVE NO SERVER IN YOUR PROFILE !");
                                    in1.close();I feel sorry for the inconvenience that is caused as i am new to using these forums.
    I have here used a simple program to retreive the names of the servers that the users have acess to..
    I have here read the servername and server ip stored from a file in UNIX in the running JSP.Now i need to pass these string variables to HTML file and display it in a Check box format.the strings host and ip have to be passed to the input of the HTML file so that they can further be processed once they are clicked using another JSP.
    Can anybody please help me in Passing these strings from the running JSP and display it in a check box format

  • How do I export bookmarks from Firefox for Mobile (android) to an html file?

    I have bookmarks on my Firefox for Mobile v 33.1 that I would like to copy/back up to an html file. Even if I access the desktop version on my tablet I don't see the Show all Bookmarks - Import/Export option. This Android profile used to be linked through the old Firefox Sync to my PC but the issue is that I can't access it from my PC anymore as I just had to replace the hard disk. I have now installed the new Firefox on my PC but it won't sync with the old Android version as the new Firefox Sync is not compatible with the old one. Also when I go under Sync on the Android, it says the email account is deprecated.
    Going forward I understand I need to remove account on the Android, update to the new Firefox Sync and newly link PC and Android device. However I have read that If I remove the account on my Android Firefox and set up the new Firefox Sync on it, I will lose my old bookmarks and it will only start saving and syncing bookmarks from then on even if I use the same email address to set it up. If this is the case and before taking this step, is there a way I can copy my old Android bookmarks to an html file?
    All suggestions very much appreciated! I'm completely lost.
    Thanks

    Tangram that is an answer for desktop Firefox. It does not apply to Firefox for Android.
    There is no way to export bookmarks/history in Firefox for Android.
    However your Firefox sync account is unrelated to the Firefox for Android profile. You can safely remove the account without loss of data. Then set up a new Sync Account.

  • Need help: Problems with exported Dreamweaver html file in different browsers

    I'm trying to send out a newsletter, and had our designer create it in Dreamweaver, and then export and html file which we uploaded.  For some reason it looks wrong on Mac's, Gmail, and a few issues with Outlook.  Does anyone know how to help with this, or had to work around this problem in the past?
    I've attached our html file as well.
    We're an eco startup with limited time and budget - so any help you have would be so appreciated.
    Thank you!!

            World Centric Monthly Newsletter   August 2009     
    Palo Alto Joins the Ban Against          
             Non-Recyclable Materials
           This Spring, Palo Alto joined the list of more than 30 cities and counties in California who are making good on their efforts toward reducing their greenhouse gas emissions
           by enacting partial or comprehensive bans on polystyrene (PS) foam and/or non-recyclable disposable foodservice containers. Around the same time, a California statewide ban on the use of PS containers was tabled before reaching the State Assembly floor. Representative
           Jerry Hill, one of AB 1358’s sponsors, pulled the bill due
           to concerns addressed in the Appropriations committee hearing of the bill, regarding the fiscal impacts which
           were not addressed in bill’s contents.
           Largely represented by the California Restaurant Association, opponents of AB 1358 lobbied legislative representatives and argued there would be a negative fiscal impact on struggling restaurant owners and their customers in order to accommodate the more expensive alternatives to PS containers.     There are the unquantifiable and “hidden” costs of contaminating our bodies and environment which would far surpass the fiscal impact on the plastics, restaurants and consumer industries. Studies published by the Foundation for Advancements in Science and Education have indicated that varying levels of styrene residues
             are present in 100% of all human fat tissue in the
             United States, as PS products are found to lose weight after in contact with hot or fatty/acidic foods and liquids, causing migration of the styrene into the food or fluid, ending up in the human body. On the high end, the levels were “one third of levels known to cause neurotoxic symptoms”. In the environment,
             PS is rarely recycled and does not biodegrade.     Supporting safer alternatives to polystyrene, in addition to the collection infrastructure and processing mechanisms for the compostable and recyclable products would help create more green jobs in the long run and would be a move in the right direction away from unnecessary harm
           to our health, our communities and our world. Keep your eyes open for a revised version of AB 1358 in Spring 2010!     For more information about polystyrene
           visit Earth Resource.     For a partial energy, emissions and water analysis
           of polystyrene and its alternatives visit our website.           World Centric Compostable
             Hot Cup Lid
             World Centric is pleased to announce we now offer a fully compostable hot cup lid that
             fits our 10oz, 12oz, 16oz,
             and 20oz paper hot cups.
           The lids can be ordered in cases of 1000 or packs of 100.
           For more information or to order, please visit our website.           This Month
             We’d Like to Applaud
           Project Open Hand
           San Francisco's non-profit
           organization that prepares and delivers food to seniors, people living with HIV and homebound critically-ill residents. For nearly 25-years Project Open Hand has been providing “meals with love” to local residents in need of help and care in
           California’s San Francisco and Alameda counties.
           Programs include meals, groceries and nutrition information as well as education and referral programs
           for all of the people served. A staff dietitian also visits several sites per week to speak with seniors and critically ill local residents about the importance of eating well
           and staying healthy.
           Project Open Hand continues to serve nearly 800,000 annually and has served as a model for over 100 organizations across the United States and the world.
           If you are interested in making a donation,
           please visit Project Open Hand.
           Help Project Open Hand continue to do what it
           does best – deliver quality food to those in need.           
    “World Centric has gone
               about every aspect of
               business in the most
               sustainable of ways. 
               It is a model for socially
               responsible business.”
               Ari Patz
               Styrophobia                          
                   Industry Trends
               Although PLA is a sustainable alternative to a petrochemical-
               derived product, its limitation has
               been not only its cost, but its inability
               to maintain structural integrity in hot temperatures and humid conditions because of its low melting pint.
               However, researchers at Teijin
               (formerly in partnership with Cargill)
               have improved their plant-based
               ‘Biofront’ PLA polymer to be able
               to withstand higher temperatures –
               by modifying its hydrolytic resistance.
             Get more information here.                          
                   Get Great Deals!
                   Check out our clearence items.
                   Did you know?
               Styrene can leach from polystyrene.
               Over the long term, this can act as
               a neurotoxin. Studies on animals
               report harmful effects of styrene
               on red-blood cells, the liver, kidney,
               and stomach organs.
               US Environmental Protection Agency (1992) “Styrene”. Air Toxics Website.                          
                   Where to Find us:
                   CRRA Conference
                   August 2 - 5
                   Palm Desert
                          Western Foodservice
    & Hospitality Expo
                 August 30 - September 1
              Livable Green
                 September 19
    San Mateo                                
         Find us:            World Centric
    2121 Staunton Ct. Palo Alto, CA
    You are subscribed as <[email protected]>. Click here to manage your email subscription preferences.
    Click here or reply to this email with 'unsubscribe' in the subject to unsubscribe from this list or if you feel you have received this message in error.
    This message was sent from World Centric 2121 Staunton Ct Palo Alto CA 94306 United States. Click here to report email abuse.
    You are subscribed as <[email protected]>. Click here to manage your email subscription preferences.
    Click here or reply to this email with 'unsubscribe' in the subject to unsubscribe from this list or if you feel you have received this message in error.
    This message was sent from World Centric 2121 Staunton Ct Palo Alto CA 94306 United States. Click here to report email abuse.

  • Is there a workaround for exported Muse html files to render accurately when opened in DreamWeaver d

    Is there a workaround for exported Muse html files to render accurately when opened in DreamWeaver design view?

    Have a look at this thread that should answer your query - http://forums.adobe.com/message/5231996.
    Thanks,
    Vinayak

Maybe you are looking for