Print an HTML string as normal text

Hello,
I have a simple html file with couple of lines in it.
I want to use the Java API to print this HTML string as normal text output.
Here is the program tht I have written:
This program compiles but doesnt give the required output.
Any suggestions:
package test.print;
import java.io.*;
public class printHTML
public printHTML()
public static void main(String[] args)
printHTML printHtml = new printHTML();
File htmlFile = new File("C:\\Jayashree\\Examples\\printHTML\\testPrint.html");
System.out.println("File name:" + htmlFile);
printHtml.print(htmlFile);
public void print(File htmlFile)
try
// PrintWriter out = new PrintWriter(new ByteArrayOutputStream());
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(htmlFile)));
System.out.println("Print Writer object:" + out);
out.println(htmlFile);
out.flush();
out.close();
catch(Exception e)
System.out.println("Exception:" + e.toString());
e.printStackTrace();
Further, if i have an file with strings like
<html> this is a test html page </html>
How do i print the string as normal text without the tags?
Thnx in advance!
Regards,
Jayashree

what is that u want
the code below worked fine for me
package com.test.io;
import java.io.*;
public class IOTest  {
  public IOTest() {
  public void print(File htmlFile) {
    try {
      PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(htmlFile)));
      out.println("<b>is this the desired result</b> or is this the one <i>what about this</i>");
      out.println("<table border=\"3\"><tr><td>there is some info here</td><tr></table>");
      out.flush();
      out.close();
    catch(Exception e) {
      System.out.println("Exception:" + e.toString());
      e.printStackTrace();
  public static void main(String [] args) {
    IOTest io = new IOTest();
    File htmlFile = new File("C:\\TEMP\\testPrint.html");
    io.print(htmlFile);
}

Similar Messages

  • How to convert CLOB data (now it is in html format) to Normal text format

    Hi,
    Can anybody let me know the solution for how to convert CLOB data into normal Text.In my case the table column having CLOB datatype and the data is in html format.when i run the report the column is displaying html tags .Now i need to convert that html tags into normal text.
    Pl. let me know if any one know the solution.
    Regards,
    Thulasi.K

    LONG has been depricated since 8i so I don't believe there is a general solution to go backwards short of reloading the data.
    Justin

  • How to print an HTML from an Applet ?

    I have a html file which has some images (<img></img> tag ) and some static contents.This html is generated by a Servlet.Currenlty i am doing a browser print. I do not want the print dialog box to appear.
    Is it possible to print this using an applet ? Using java print ?
    I am able to print a image from an applet using java print.
    But i am not able to print a html with images and text.
    Is there any way to convert such html into a image(jpeg,bmp) using java api ?

    I tried the Java printing API in 1.4.2 but found it hopeless in terms of printing anything without using AWT.
    Also since the print service was going to be on Windows machine I used jawin (http://sf.net/projects/jawinproject/) to query the registry for the command to print a particular extension and then exec that command.

  • How can I print a html Using javax.print

    Hi friends,
    I am in big trouble . I use following code to print a html file using javax.print api.
    import java.io.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.print.event.*;
    public class PrintPS
         public static void main(String args[]) {
              PrintPS html = new PrintPS();
         public PrintPS() {
         DocFlavor flavor = DocFlavor.INPUT_STREAM.TEXT_HTML_HOST;
         PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
         aset.add(MediaSizeName.ISO_A4);
         aset.add(new Copies(1));
         aset.add(MediaTray.MAIN);
         PrintService pservices = PrintServiceLookup.lookupDefaultPrintService();
         if(pservices==null)
              System.out.println(" printer not found");
         if (pservices!= null) {
         System.out.println("selected printer " + pservices.getName());
         DocPrintJob pj = pservices.createPrintJob();
         try {
         InputStream fis = new FileInputStream("abc.html");
         Doc doc = new SimpleDoc(fis, flavor, null);
    System.out.println("printing started ");
         pj.print(doc, aset);
    System.out.println("printing completed");
         } catch (IOException ie) {
         System.err.println(ie);
         } catch (PrintException e) {
         System.err.println(e);
    This code gives me "sun.print.PrintJobFlavorException: invalid flavor"
    So i use all four TEXT_HTML flavor but i do not find the solution.
    I am able to print pdf, jpg, gif files but i can not able to print txt and html file.
    My printer supports txt and html printing becaue i do printing directolly by browser's or notpad's print command .

    Hi friends,
    I am in big trouble . I use following code to print a
    html file using javax.print api.Use Code Tags
    http://forum.java.sun.com/help.jspa?sec=formatting
    My printer supports txt and html printing becaue i do
    printing directolly by browser's or notpad's print
    command .Notepad & your browser prob. convert to the HTML/text(1) into the printers native format.
    1) I am suprised that it does not print text.

  • How to parse select lines in an html string?

    I've been writing a program to deal with demographic data and the first server it calls returns an xml string. However, the backup server returns an html string instead of an xml string, so the formatting is a bit different. I was going to use a regex as I did with the xml server, but regex's don't work that well with html. i was wondering if you could offer some advice on how to effectively parse the html string? It is in this format <html>
    <head>
    <meta name="Description" content="ZIP Code Demographics"/>
    <meta name="Keywords" content="zip, zip code, zipcode, demographics, 2000, county, lookup, city, state"/>
    <title>ZIP Code Demographics Lookup</title>
    <link rel="stylesheet" type="text/css" href="http://www.MelissaData.com/style.css" />
    </head>
    <body topmargin="0" onload="document.getElementById('text1').focus()">
    <div align="center">
    <!--Start of top.asp 9/2/08 Ray-->
    <script type='text/javaScript' src='http://www.melissadata.com/cgi-bin/lib.js'></script>
        <table align="center" border="0" cellpadding="0" cellspacing="0" width="744" style="font-size:8pt; font-family:Arial; color: #666666">
            <tr valign='middle'  height='24'>
                 <td align="left" rowspan=2><a href="/index.htm">
                    <img border="0" src="http://www.melissadata.com/home/new1207/MelissaData-logo.gif" alt="Melissa Data Home Page" /></a><img border="0" src="http://www.melissadata.com/home/new1207/1-800-number.gif" width="112" height="22" alt="Call 1-800-MELISSA for Data Quality Solutions" /></td>
                <td colspan='2' align="right">
                    <font size="1" face="Verdana">
                <script type="text/javaScript">var r=uCookie("r"); var s=uCookie("s"); var n=uCookie("n");
                    //document.write (document.cookie);
                    if (r == "YES" && s == "IN" && n != "" ) document.write ("Hello <b>" + n.replace(/\+/g," ") + "<\/b>   [<font size=1><a href=/user/signout.aspx>Sign out<\/a>, <a href=/user/user_account.aspx>My Account<\/a></font>]");else document.write (" <a href=/user/signin.aspx>Sign In<\/a> ");
                </script></font></td></tr>
            <tr height='24'>
                <form method="get" action="http://w2.melissadata.com/cgi-bin/search.asp">          
                <td align="right" height=30>               
                    <a href="/netcart/order1.aspx"><img border="0" src="http://www.melissadata.com/home/new1207/Hompage-shoppincart.gif" alt="Shopping Cart" /></a>
                    <a style="color: #666666" href="/netcart/order1.aspx">Buy</a>
                    | <a style="color: #666666" href="/cgi-bin/newsletters.asp">Newsletters</a> | Search
                    <input name="indata" style="font-size:7pt; font-family:Arial" size="10" /><input type="image" src="http://www.melissadata.com/home/new1207/hompage-arrow.gif" style="vertical-align: middle"  value="Search" name="submit1" />
        </td></form></tr>
        </table>
        <style="font-size:10pt; font-family:Arial; color: #0066cc" type="text/css">
        <table align="center" border="0" cellpadding="4" cellspacing="0" width="744">
            <tr>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/products/index.htm">Products</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/solutions/index.htm">Solutions</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/download.htm">Downloads</a> </b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/tech/tech.html">Support</a> </font></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/resources/index.htm">Resources</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/lookups/index.htm">Lookups</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/cgi-bin/contact.asp">Contact Us</a></b></td></tr>   
        </table></style>
    <!-- Start Image BanAd.asp-->
    <div align=center><a href='/cgi-bin/BanAd.asp?id=135'><img alt='Click here' src='/cgi-bin/BanImage.asp?id=135'></a></div><!-- End Image BanAd.asp-->
    <!--TitleBorder in Shared.asp -->
    <table width="744" cellspacing=0 border=1 bgcolor="#F7F7F7"><tr><td align=left><font color="#ce0000" size="5">ZIP Code Demographics Lookup</font></td><form><td width=120 align=center><input title='Help for ZIP Code Demographics Lookup' type=button onClick=openHelpWindow('/lookups/help/zipdemo2000.asp') value=Help>  <a title='Lookups home page' href=/lookups/index.htm>Index</a></td></form></tr></table>
    <!--TitleBorder End-->
    <form action="ZipDemo2000.asp" name="Demo2000">
    <table width="400" class="Disp">
    <tr><td align="center"><b>Enter a 5-Digit ZIP Code</b>
        <input class="Disp" title="Enter a ZIP Code" id="text1" size="5" name="ZipCode" maxlength="5"/> <input type="submit" value="Submit"/>
    </td></tr>
    </table>
    </form>
    <table cellspacing="0" cellpadding="1" width="750" border="2" bgcolor="#ffffcc">
    <tr bgcolor="lightblue"><td colspan="4" align="center">Year 2000 Demographics of <br><b>ZIP Code 90041</b><br><b>LOS ANGELES, California</b><br><a href=mapzipv.asp?zip=90041>Map of ZIP Code</a></td></tr>
    <tr bgcolor="#bbffff"><td>TOTAL POPULATION [1]</td><td >P001</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P001</td></tr>
    <tr><td>   Total</td><td align=right ><b> 27,864</b></td></tr>
    <tr bgcolor="#bbffff"><td>URBAN AND RURAL [6]</td><td >P002</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P002</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         Urban:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>           Inside urbanized areas</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>           Inside urban clusters</td><td align=right ><b> 0</b></td></tr>
    <tr><td>         Rural</td><td align=right ><b> 0</b></td></tr>
    <tr><td>         Not defined for this file</td><td align=right ><b> 0</b></td></tr>
    <tr bgcolor="#bbffff"><td>RACE [8]</td><td >P007</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P007</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         White alone</td><td align=right ><b> 13,429</b></td></tr>
    <tr><td>         Black or African American alone</td><td align=right ><b> 630</b></td></tr>
    <tr><td>         American Indian and Alaska Native alone</td><td align=right ><b> 242</b></td></tr>
    <tr><td>         Asian alone</td><td align=right ><b> 7,123</b></td></tr>
    <tr><td>         Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 42</b></td></tr>
    <tr><td>         Some other race alone</td><td align=right ><b> 4,738</b></td></tr>
    <tr><td>         Two or more races</td><td align=right ><b> 1,660</b></td></tr>
    <tr bgcolor="#bbffff"><td>HISPANIC OR LATINO BY RACE [17]</td><td >P008</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P008</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         Not Hispanic or Latino:</td><td align=right ><b> 17,109</b></td></tr>
    <tr><td>           White alone</td><td align=right ><b> 8,468</b></td></tr>
    <tr><td>           Black or African American alone</td><td align=right ><b> 555</b></td></tr>
    <tr><td>           American Indian and Alaska Native alone</td><td align=right ><b> 105</b></td></tr>
    <tr><td>           Asian alone</td><td align=right ><b> 7,053</b></td></tr>
    <tr><td>           Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 30</b></td></tr>
    <tr><td>           Some other race alone</td><td align=right ><b> 73</b></td></tr>
    <tr><td>           Two or more races</td><td align=right ><b> 825</b></td></tr>
    <tr><td>         Hispanic or Latino:</td><td align=right ><b> 10,755</b></td></tr>
    <tr><td>           White alone</td><td align=right ><b> 4,961</b></td></tr>
    <tr><td>           Black or African American alone</td><td align=right ><b> 75</b></td></tr>
    <tr><td>           American Indian and Alaska Native alone</td><td align=right ><b> 137</b></td></tr>
    <tr><td>           Asian alone</td><td align=right ><b> 70</b></td></tr>
    <tr><td>           Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 12</b></td></tr>
    <tr><td>           Some other race alone</td><td align=right ><b> 4,665</b></td></tr>
    <tr><td>           Two or more races</td><td align=right ><b> 835</b></td></tr>
    <tr bgcolor="#bbffff"><td>SEX BY AGE [49]</td><td >P012</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P012</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         Male:</td><td align=right ><b> 13,324</b></td></tr>
    <tr><td>           Under 5 years</td><td align=right ><b> 862</b></td></tr>
    <tr><td>           5 to 9 years</td><td align=right ><b> 974</b></td></tr>
    <tr><td>           10 to 14 years</td><td align=right ><b> 872</b></td></tr>
    <tr><td>           15 to 17 years</td><td align=right ><b> 525</b></td></tr>
    <tr><td>           18 and 19 years</td><td align=right ><b> 511</b></td></tr>
    <tr><td>           20 years</td><td align=right ><b> 257</b></td></tr>
    <tr><td>           21 years</td><td align=right ><b> 287</b></td></tr>
    <tr><td>           22 to 24 years</td><td align=right ><b> 569</b></td></tr>
    <tr><td>           25 to 29 years</td><td align=right ><b> 969</b></td></tr>
    <tr><td>           30 to 34 years</td><td align=right ><b> 1,024</b></td></tr>
    <tr><td>           35 to 39 years</td><td align=right ><b> 1,140</b></td></tr>
    <tr><td>           40 to 44 years</td><td align=right ><b> 1,077</b></td></tr>
    <tr><td>           45 to 49 years</td><td align=right ><b> 987</b></td></tr>
    <tr><td>           50 to 54 years</td><td align=right ><b> 822</b></td></tr>
    <tr><td>           55 to 59 years</td><td align=right ><b> 647</b></td></tr>
    <tr><td>           60 and 61 years</td><td align=right ><b> 215</b></td></tr>
    <tr><td>           62 to 64 years</td><td align=right ><b> 270</b></td></tr>
    <tr><td>           65 and 66 years</td><td align=right ><b> 155</b></td></tr>
    <tr><td>           67 to 69 years</td><td align=right ><b> 258</b></td></tr>
    <tr><td>           70 to 74 years</td><td align=right ><b> 320</b></td></tr>
    <tr><td>           75 to 79 years</td><td align=right ><b> 252</b></td></tr>
    <tr><td>           80 to 84 years</td><td align=right ><b> 183</b></td></tr>
    <tr><td>           85 years and over</td><td align=right ><b> 148</b></td></tr>
    <tr><td>         Female:</td><td align=right ><b> 14,540</b></td></tr>
    <tr><td>           Under 5 years</td><td align=right ><b> 864</b></td></tr>
    <tr><td>           5 to 9 years</td><td align=right ><b> 949</b></td></tr>
    <tr><td>           10 to 14 years</td><td align=right ><b> 875</b></td></tr>
    <tr><td>           15 to 17 years</td><td align=right ><b> 534</b></td></tr>
    <tr><td>           18 and 19 years</td><td align=right ><b> 592</b></td></tr>
    <tr><td>           20 years</td><td align=right ><b> 285</b></td></tr>
    <tr><td>           21 years</td><td align=right ><b> 264</b></td></tr>
    <tr><td>           22 to 24 years</td><td align=right ><b> 600</b></td></tr>
    <tr><td>           25 to 29 years</td><td align=right ><b> 932</b></td></tr>
    <tr><td>           30 to 34 years</td><td align=right ><b> 1,035</b></td></tr>
    <tr><td>           35 to 39 years</td><td align=right ><b> 1,026</b></td></tr>
    <tr><td>           40 to 44 years</td><td align=right ><b> 1,131</b></td></tr>
    <tr><td>           45 to 49 years</td><td align=right ><b> 1,038</b></td></tr>
    <tr><td>           50 to 54 years</td><td align=right ><b> 970</b></td></tr>
    <tr><td>           55 to 59 years</td><td align=right ><b> 689</b></td></tr>
    <tr><td>           60 and 61 years</td><td align=right ><b> 261</b></td></tr>
    <tr><td>           62 to 64 years</td><td align=right ><b> 327</b></td></tr>
    <tr><td>           65 and 66 years</td><td align=right ><b> 208</b></td></tr>
    <tr><td>           67 to 69 years</td><td align=right ><b> 307</b></td></tr>
    <tr><td>           70 to 74 years</td><td align=right ><b> 482</b></td></tr>
    <tr><td>           75 to 79 years</td><td align=right ><b> 450</b></td></tr>
    <tr><td>           80 to 84 years</td><td align=right ><b> 331</b></td></tr>
    <tr><td>           85 years and over</td><td align=right ><b> 390</b></td></tr>
    <tr bgcolor="#bbffff"><td>MEDIAN AGE BY SEX [3]</td><td >P013</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P013</td></tr>
    <tr bgcolor="#bbffff"><td>Median age--</td><td >P013</td></tr>
    <tr><td>         Both sexes</td><td align=right ><b> 35.3</b></td></tr>
    <tr><td>         Male</td><td align=right ><b> 34.0</b></td></tr>
    <tr><td>         Female</td><td align=right ><b> 36.6</b></td></tr>
    <tr bgcolor="#bbffff"><td>HOUSEHOLDS [1]</td><td >P015</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Households</td><td >P015</td></tr>
    <tr><td>   Total</td><td align=right ><b> 9,375</b></td></tr>
    <tr bgcolor="#bbffff"><td>POPULATION IN HOUSEHOLDS [1]</td><td >P016</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Population in households</td><td >P016</td></tr>
    <tr><td>   Total</td><td align=right ><b> 26,409</b></td></tr>
    <tr bgcolor="#bbffff"><td>AVERAGE HOUSEHOLD SIZE [1]</td><td >P017</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Households</td><td >P017</td></tr>
    <tr><td>   Average household size</td><td align=right ><b> 2.82</b></td></tr>
    <tr bgcolor="#bbffff"><td>FAMILIES [1]</td><td >P031</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Families</td><td >P031</td></tr>
    <tr><td>   Total</td><td align=right ><b> 6,326</b></td></tr>
    <tr bgcolor="#bbffff"><td>POPULATION IN FAMILIES [1]</td><td >P032</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Population in families</td><td >P032</td></tr>
    <tr><td>   Total</td><td align=right ><b> 21,653</b></td></tr>
    <tr bgcolor="#bbffff"><td>AVERAGE FAMILY SIZE [1]</td><td >P033</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Families</td><td >P033</td></tr>
    <tr><td>   Average family size</td><td align=right ><b> 3.42</b></td></tr>
    </table>
    <!-- Start of bottom.asp-->
        <hr width="730" />
        <span style='font-size:8pt'>
        <a href="http://www.melissadata.com/enews/advisorarticles/index.htm">Articles</a> | 
        <a href="javascript:window.external.AddFavorite('http://www.melissadata.com/lookups/zipdemo2000.asp', 'ZIP Code Demographics Lookup')" target="_self">Bookmark</a> | 
        <a href="http://www.melissadata.com/cgi-bin/improve.asp?web">How Can We Improve?</a> | 
        <a href="http://www.melissadata.com/cgi-bin/batchprocessing.asp">Batch Processing</a> | 
        <a href="http://www.melissadata.com/cgi-bin/send.asp?Send2Friend">Email to Friend</a> | 
        <a href="http://www.melissadata.com/cgi-bin/catalogres.asp">Free Catalog</a> | 
        <a href="http://forum.melissadata.com/default.aspx">Forums</a> | 
        <a href="http://www.melissadata.com/terms-of-use.htm">Terms of Use</a>
        <font color="#ddddff"><br />  
        <script type="text/javascript"> var r=uCookie("r"); var f=uCookie("f"); var c=uCookie("c"); var l=uCookie("l");
            //document.write (r + ":" + f + ":" + c + ":" + l);</script></font></span>
    <!-- End of bottom.asp-->
    </div>
    </body>
    </html>.
    The numbers I wanted to extract are the age groups of "Under 5 years," "5 to 9 years," "10 to 14 years," and "15 to 17 years," from both male and female groups, which should add up to 8 numbers total. Here is the backup server portion of my program as well, so you can see what i'm doing.
    import java.net.*;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.HttpURLConnection;
    import java.io.*;
    import java.io.DataOutputStream;
    import java.io.BufferedReader;
    import java.io.StringReader;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.util.Scanner;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.util.Arrays;
    public class TriParser
         static Scanner sc = new Scanner(System.in);
         public static int[] findValues(String text, String gender, String[] labels)
                Matcher m = Pattern.compile("<td>(.*?)</td>",
               Pattern.MULTILINE | Pattern.DOTALL).matcher(text);
                String allValues = m.find() ? m.group(1) : null; // TODO: handle if 'null' is returned!
                int[] values = new int[labels.length];
                for(int i = 0; i < labels.length; i++)
                  m = Pattern.compile(labels[i]+"[^>]+>(\\d+)").matcher(allValues);
                  if(m.find()) values[i] = Integer.parseInt(m.group(1));
                return values;
         public static void main(String[] args) throws Exception
            int zip;
            boolean validInteger;//indicates if zipcode is valid (has to be 5 digits)
            do
                    System.out.print("Enter a five-digit zipcode: ");
                    zip = sc.nextInt();
                    validInteger = true;
                    if((zip < 10000) || (zip > 99999))
                            validInteger = false;
                            System.out.println("Invalid Entry.  Please re-enter zipcode.");
            while(!validInteger);
            System.out.println(zip);     
            //String requestPart1 ="query=PREFIX+dc%3A++%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E+%0D%0APREFIX+census%3A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fschema%2Fcensus%2F%3E+%0D%0APREFIX+census1%3A+%3Ctag%3Agovshare.info%2C2005%3Ardf%2Fcensus%2Fdetails%2F100pct%2F%3E+%0D%0A%0D%0ADESCRIBE+%3Ftable+WHERE+%7B+%0D%0A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fusgov%2Fgeo%2Fcensus%2Fzcta%2F";
            //String requestPart2 = "" + zip; // zipcode goes here
            //String requestPart3 ="%3E+census%3Adetails+%3Fdetails+.+%0D%0A+%3Fdetails+census1%3AtotalPopulation+%3Ftable+.+%0D%0A+%3Ftable+dc%3Atitle+%22SEX+BY+AGE+%28P012001%29%22+.+%0D%0A%7D%0D%0A&outputMimeType=text%2Fxml";
              String requestPart1 = "" + zip;
            String response = "";
            URL url = new URL("http://www.melissadata.com/lookups/zipdemo2000.asp?ZipCode="+requestPart1);
            URLConnection conn = url.openConnection();
            // Set connection parameters.
            conn.setDoInput (true);
            conn.setDoOutput (true);
            conn.setUseCaches (false);
            // Make server believe we are form data…
            conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
            DataOutputStream out = new DataOutputStream (conn.getOutputStream ());
            // Write out the bytes of the content string to the stream.
            out.writeBytes(requestPart1);
            out.flush ();
            out.close ();
            // Read response from the input stream.
            BufferedReader in = new BufferedReader (new
            InputStreamReader(conn.getInputStream ()));
            String temp;
            while ((temp = in.readLine()) != null)
                 response += temp + "\n"; // needs to be parsed to calculate the 4 numbers
            temp = null;
            in.close ();
              //System.out.println("Server response:\n" + response);
              // how to call the method:
              String[] ages = {"Under 5 years", "5 to 9 years", "10 to 14 years", "15 to 17 years"};
              String[] ages1 = {"Under 5 years"};
              String[] ages2 = {"5 to 9 years"};
              String[] ages3 = {"10 to 14 years"};
              String[] ages4 = {"15 to 17 years"};
              String female1 = Arrays.toString(findValues(response, "female", ages1));
              String female2 = Arrays.toString(findValues(response, "female", ages2));
              String female3 = Arrays.toString(findValues(response, "female", ages3));
              String female4 = Arrays.toString(findValues(response, "female", ages4));
              String female = female1 + "+" + female2 + "<" + female3 + ">" + female4 + "&";
              String male1 = Arrays.toString(findValues(response, "male", ages1));
              String male2 = Arrays.toString(findValues(response, "male", ages2));
              String male3 = Arrays.toString(findValues(response, "male", ages3));
              String male4 = Arrays.toString(findValues(response, "male", ages4));
              String male = male1 + "+" + male2 + "<" + male3 + ">" + male4 + "&";
              System.out.println(female);
              System.out.println(male);
            //Simplified string response, makes use of regular expressions
            //Start manipulation of numbers inside string
            int left = female.indexOf("[");
              int right = female.indexOf("]");
              // pull out the text inside the parens
              String parsed = female.substring(left+1, right);
              double parseddub = Double.parseDouble(parsed);
              //divide the group Under5Years into Under12Mo and 1to4Yr
              double Group1Adub = parseddub*.25;//25% for Under12Mo
              Group1Adub = Math.ceil(Group1Adub);
              int Group1A =(int)Group1Adub;
              double Group1Bdub = parseddub*.75;//75% for 1to4Yr
              Group1Bdub = Math.ceil(Group1Bdub);
              int Group1B =(int)Group1Bdub;
              int left2 = female.indexOf("+");
              int right2 = female.indexOf("<");
              // pull out the text inside the parens
              String parsed2 = female.substring(left2+2, right2-1);
              double parsed2dub = Double.parseDouble(parsed2);
              //divide the group 5to9Yr into 5Yr, 6to7Yr, and 8to9Yr
              double Group2Adub = parsed2dub*.2;//20% for 5Yr
              Group2Adub = Math.ceil(Group2Adub);
              int Group2A =(int)Group2Adub;
              double Group2Bdub = parsed2dub*.4;//40% for 6to7Yr
              Group2Bdub = Math.ceil(Group2Bdub);
              int Group2B =(int)Group2Bdub;
              double Group2Cdub = parsed2dub*.2;//20% for 8Yr
              Group2Cdub = Math.ceil(Group2Cdub);
              int Group2C =(int)Group2Cdub;
              double Group2Ddub = parsed2dub*.2;//20% for 9Yr
              Group2Ddub = Math.ceil(Group2Ddub);
              int Group2D =(int)Group2Ddub;
              int left3 = female.indexOf("<");
              int right3 = female.indexOf(">");
              // pull out the text inside the brackets
              String parsed3 = female.substring(left3+2, right3-1);
              int Group3A = Integer.valueOf(parsed3).intValue();
              int left4 = female.indexOf(">");
              int right4 = female.indexOf("&");
              // pull out the text inside the brackets
              String parsed4 = female.substring(left4+2, right4-1);
              int Group4A = Integer.valueOf(parsed4).intValue();
              int left5 = male.indexOf("[");
              int right5 = male.indexOf("]");
              String parsed5 = male.substring(left5+1, right5);
              double parsed5dub = Double.parseDouble(parsed5);
              //divide the group Under5Years into Under12Mo and 1to4Yr
              double Group5Adub = parsed5dub*.25;//25% for Under12Mo
              Group5Adub = Math.ceil(Group5Adub);
              int Group5A =(int)Group5Adub;
              double Group5Bdub = parsed5dub*.75;//75% for 1to4Yr
              Group5Bdub = Math.ceil(Group5Bdub);
              int Group5B =(int)Group5Bdub;     
              int left6 = male.indexOf("+");
              int right6 = male.indexOf("<");
              // pull out the text inside the parens
              String parsed6 = male.substring(left6+2, right6-1);
              double parsed6dub = Double.parseDouble(parsed6);
              //divide the group 5to9Yr into 5Yr, 6to7Yr, and 8to9Yr
              double Group6Adub = parsed6dub*.2;//20% for 5Yr
              Group6Adub = Math.ceil(Group6Adub);
              int Group6A =(int)Group6Adub;
              double Group6Bdub = parsed6dub*.4;//40% for 6to7Yr
              Group6Bdub = Math.ceil(Group6Bdub);
              int Group6B =(int)Group6Bdub;
              double Group6Cdub = parsed6dub*.2;//20% for 8Yr
              Group6Cdub = Math.ceil(Group6Cdub);
              int Group6C =(int)Group6Cdub;
              double Group6Ddub = parsed6dub*.2;//20% for 9Yr
              Group6Ddub = Math.ceil(Group6Ddub);
              int Group6D =(int)Group6Ddub;
              int left7 = male.indexOf("<");
              int right7 = male.indexOf(">");
              // pull out the text inside the brackets
              String parsed7 = male.substring(left7+2, right7-1);
              int Group7A = Integer.valueOf(parsed7).intValue();
              int left8 = male.indexOf(">");
              int right8 = male.indexOf("&");
              // pull out the text inside the brackets
              String parsed8 = male.substring(left8+2, right8-1);
              int Group8A = Integer.valueOf(parsed8).intValue();
              //female
              int Group1 = Group1A;
              int Group2 = Group1B + Group2A;
              int Group3 = Group2A + Group2B + Group2C;
              int Group4 = Group2C + Group2D + Group3A + Group4A;     
              //male
              int Group5 = Group5A;
              int Group6 = Group5B + Group6A;
              int Group7 = Group6A + Group6B + Group6C;
              int Group8 = Group6C + Group6D + Group7A + Group8A;
              System.out.println("Server response:\n" + "\n" + "Female");
              System.out.println("Under 12 Months:    " + Group1);
              System.out.println("1 to 4 Years Old:   " + Group2);
              System.out.println("5 to 8 Years Old:   " + Group3);
              System.out.println("8 to 17 Years Old:  " + Group4);
              System.out.println("\n" + "Male");
              System.out.println("Under 12 Months:    " + Group5);
              System.out.println("1 to 4 Years Old:   " + Group6);
              System.out.println("5 to 8 Years Old:   " + Group7);
              System.out.println("8 to 17 Years Old:  " + Group8);
    }Currently it functions using a regex, and executes, but doesn't return any numbers, only returns zeros...If you could help me out with this, that would be amazing! Thanks so much.

    hmm, is there a way to do it without an external API? Of course there is.
    looks like i have to download the API and the idea behind the program is to make it so multiple people running only java can run the program, without having to download APIs, ect, to make it run. Not sure if that is what JTidy entails, but is that what you were suggesting?Personally, I don't understand the resistance to using well-tested tools already in existence as opposed to trying to rewrite a shallow facsimile of said tools. You can distribute the JTidy library along with your application and save yourself a great deal of development and debugging effort.
    ~

  • How can I convert Binary File to Normal Text File?

    Hi,
    I need to read a binary file and need to conevrt as normal text file. The binary file contains some number & String (Names) with fixed length. It is the combination of Char, String, Integer, Byte & Single Bit.
    I used DataInputStream but I didnt get the expected output. Can anybody help me in reading a binary file?
    Thanks & Regards,
    Pattanaik.

    http://java.sun.com/docs/books/tutorial/essential/io/dataIO.html provides an example of using DataInputStream to do what you want.

  • How to write Strings in a text file with BufferedWriter

    I've got a Vector object full of Strings objects, I'm interested in wrinting these Strings in a text file with a BufferedWriter , I would apreciate some code, thank you

    http://java.sun.com/products/jdk/1.2/docs/api/java/io/BufferedWriter.html
    "PrintWriter out = new PrintWriter(new BufferedWriter((new FileWriter("foo.out")));"

  • How to print a html document in landscape mode with css

    Hi ,
    below is my code that i need to print in landscape mode by defualt with css. is there any way to do this
    <html><head><style type="text/css">
    table.automatic {table-layout:fixed; width:100%; border-collapse: collapse; word-wrap:break-word;}TR.head{font-family: verdana; font-size: 10pt; vertical-align: top ; color: #ffffff; background-color: black; font-weight: bold; }TR.data{font-family: verdana; font-size: 8pt; vertical-align: top}</style></head><body><table width="100%" border="0" cellspacing="0" cellpadding="4"><tbody><tr><td></td><td align="center"><font size="2" style="verdana"><b>EMERGENCY ICE Installs by Manager And Production Install Date Range</b></font><br><td></td><table width="100%" border="0" cellspacing="0" cellpadding="4"><thead><tr><td width="74%" align="center"><font size="1" style="verdana"><b>From:</b>09/01/07</font><font size="1" style="verdana"><b>&nbsp&nbspTo:</b>01/08/08</font></td></tr></thead></table></td></tr></tbody></table><br></br>
    <table border="1" class="automatic"><thead><tr class="head"><td width="8%">Manager</td><td width="5%">ICE # </td><td width="10%">Plan Prod Install Date</td><td width="10%">Doc Status</td><td width="10%">Doc Title</td><td width="7%">Owner</td><td width="5%">Risk Desc</td><td width="4%">AS/400</td><td width="4%">Unix</td><td width="4%">Win Srv</td><td width="4%">Win Dsk</td><td width="4%">Vax</td><td width="5%">Target Loc</td><td width="10%">No Chg Risk Desc</td><td width="15%">Brief Chg Desc</td></tr></thead><tbody>
    <tr class="data"><td rowspan="12" width="5%">Randal Hockenberry</td><td width="8%">16926</td><td width="10%">Dec 31,2007</td><td width="10%">Pending Manager-Business Review</td><td width="10%">AUTO APPROVE</td><td width="7%">Padma Chirumalla</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="5%">TEST</td><td width="10%">TEST</td><td width="15%">TESTzxdcxvsrfdgdsgfdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</td></tr>
    <tr class="data"><td width="8%">16933</td><td width="10%">Dec 28,2007</td><td width="10%">Pending Non-QS Testing</td><td width="10%">SR</td><td width="7%">Padma Chirumalla</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="5%">XC</td><td width="10%">DFV</td><td width="15%">CX</td></tr>
    <tr class="data"><td width="8%">16927</td><td width="10%">Dec 28,2007</td><td width="10%">Pending Risk Review</td><td width="10%">AUTO APPROVAL TEST</td><td width="7%">Padma Chirumalla</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="5%">AUTO</td><td width="10%">AUTO APPROVE</td><td width="15%">AUTO APPROVE</td></tr>
    <tr class="data"><td width="8%">15926</td><td width="10%">Nov 27,2007</td><td width="10%">Pending Code Review</td><td width="10%">CM Install LEVEL 3 QS will test</td><td width="7%">Gary Zhong</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="4%">Y</td><td width="5%">pitt99</td><td width="10%">testing the app</td><td width="15%">CM Install LEVEL 3 QS will test</td></tr>
    <tr class="data"><td width="8%">15712</td><td width="10%">Nov 22,2007</td><td width="10%">Rejected</td><td width="10%">Test Documentation Request</td><td width="7%">Autumn Priddy</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="5%">x</td><td width="10%">none</td><td width="15%">run-through for documentation purposes</td></tr>
    <tr class="data"><td width="8%">16029</td><td width="10%">Nov 21,2007</td><td width="10%">Rejected</td><td width="10%">Contractor</td><td width="7%">Padma Chirumalla</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="5%">Windows</td><td width="10%">testing</td><td width="15%">Testing</td></tr>
    <tr class="data"><td width="8%">16030</td><td width="10%">Nov 19,2007</td><td width="10%">Rejected</td><td width="10%">Contractor</td><td width="7%">Padma Chirumalla</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="5%">Windows</td><td width="10%">testing</td><td width="15%">Testing</td></tr>
    <tr class="data"><td width="8%">15840</td><td width="10%">Nov 10,2007</td><td width="10%">Pending Follow Up Review</td><td width="10%">SMS Install LEVEL 3</td><td width="7%">Stephen Sciullo</td><td width="5%">Low</td><td width="4%">Y</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="5%">pitt88</td><td width="10%">system testing</td><td width="15%">SMS Install LEVEL 3</td></tr>
    <tr class="data"><td width="8%">15719</td><td width="10%">Nov 08,2007</td><td width="10%">Pending Test Install</td><td width="10%">CM Install LEVEL 1 pitt3/col3</td><td width="7%">Stephen Sciullo</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="5%">pitt88</td><td width="10%">testing</td><td width="15%">testing</td></tr>
    <tr class="data"><td width="8%">14815</td><td width="10%">Nov 03,2007</td><td width="10%">Rejected</td><td width="10%">test</td><td width="7%">Stephen Sciullo</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">Y</td><td width="4%">N</td><td width="5%">pitt2</td><td width="10%">test</td><td width="15%">test</td></tr>
    <tr class="data"><td width="8%">14915</td><td width="10%">Nov 01,2007</td><td width="10%">Pending Follow Up Review</td><td width="10%">Contractor</td><td width="7%">Padma Chirumalla</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="5%">windows</td><td width="10%">test</td><td width="15%">Test</td></tr>
    <tr class="data"><td width="8%">14816</td><td width="10%">Oct 31,2007;Nov 01,2007;Nov 02,2007</td><td width="10%">Production Install Complete</td><td width="10%">Contractor</td><td width="7%">Padma Chirumalla</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="4%">N</td><td width="5%">windows</td><td width="10%">test</td><td width="15%">test</td></tr>
    <tr></tr>
    <tr class="data"><td rowspan="1" width="5%">Linda Humm</td><td width="8%">16034</td><td width="10%">Dec 06,2007</td><td width="10%">Pending Production Install</td><td width="10%">CM Install LEVEL 1 pitt3/col3</td><td width="7%">Randal Hockenberry</td><td width="5%">Low</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">N</td><td width="4%">Y</td><td width="5%">pitt88</td><td width="10%">testing</td><td width="15%">testing</td></tr>
    <tr></tr>
    </tbody></table><body></html>
    Thanks,

    Why are you asking a CSS question in a Java/JSP/JSTL forum? I would rather use a CSS forum for that. That HTML code is unnecessary too. Just post relevant code only, such as that CSS snippet.
    Anyway, it may differ per web browser if this page rule will be picked up and it may also be a client side setting regarding printer settings. Nothing to do here.

  • Problem removing html tags from the text retrived

    Hi there,
    I am using jdbc to connect the database and retriving the data. In one of the columns along with the description there are some html tags in few of the recors of that column. is there a way to retrive the text only ignoring the html tags in between. Or can i retrive and then strip off the html code in the text to display only normal text.
    example of the data retrived which are pipe seperated and one of the columns has html tags in it:
    209|The euphoria |187945-2|http://www.abc/lst.jsp?mktgChannel=I86023&sku=18791-2&siteID=qpF0HYnRugA|http://www.abc.com/assets/images/product/medium/18793-2_198.jpg|Rooftop Singers: Walk Right In | abc Music proudly presents THE FOLK YEARS, an unforgettable era in music history!<BR><BR><B>Featuring:</B><BR>
    <LI>The most complete collection of folk and folk-rock songs ever put together -- 132 classics!
    <LI>Original hits by the original artists!
    Now i need to remove the tags before displaying this on the output. Is there a simple way to do this.
    Thanks...

    Did you read the documentation of the trim() method,
    where it describes which whitespace it removes?I believe his problem is that
    "Some text here  
    <blah> 
    More text"becomes
    "Some text here  
    More text"... and he wants ...
    "Some text here
    More text"So, your problem is that your regex isn't matching whitespace as well.
    See the "Trimming Whitespace" section:
    http://www.regular-expressions.info/examples.html

  • When I click Buy Book this appears our book appears to have default text that has not been edited. Printed books will not include this text. Do you want to continue? will the text I have sellected still be ok or will the book have missing text help Pleas?

    I just spent 3 days creating a book [32 pages], with photos and text but when I click Buy Book In iPhoto this appears>
    Our book appears to have default text that has not been edited. Printed books will not include this text. Do you want to continue?
    My question is will the text I have sellected to use still be ok, am I safe to continue and buy or will the book have missing text ?
    The book is for special birtday in 2 weeks time  Please Help.G
    <Email Edited by Host>

    Yes, you're safe to continue.  That means that there are text boxes that you did not put any text into and they contain the holding text which will not be printed.  That text is shown in a light grayt and is in Latin.  Normally you can just put a space in the text box to replace the holding text so as not to get that warning message.
    Before ordering the book proof the book according to this Apple document: iPhoto, Aperture: Previewing an order in iPhoto or Aperture. Check the pdf file for any missing text or photos and any warning indicators in the text boxes indicating that some of the text has exceeded the space allotted in the text box.
    Keep the pdf file to compare with the printed copy when you reciive it.
    OT

  • PDFs printing with black background and white text.

    For some reason some of our PDF's have been printing with black backgrounds and white text, even though they appear to be normal on the screen before they are printed. I haven't been able to confirm 100% yet but it appears to only be happening with pdfs that were created from scanned documents.
    Can somebody please offer me some suggestions.

    Absolutely agree with the original poster.  I find white text on black background so very very difficult (I changed from using Tweetbot on iOS to Tweetlogix for this very reason) and it physically hurts my eyes to try to read it.  I can just about manage with Spotify using white text on a black background on the large screen of my MacBook Pro - and I do mean "just" - but for the smaller screen of my iPhone 5 it is just impossible.  Even with a retina screen such as that on the iPhone 5S there is a strange ghosting effect and it gives me a headache to look at it for too long. 
    This may be something to do with age!  I suspect most app developers are youngsters with almost perfect eyesight, but for those of us whose eyesight is less than perfect, this white text on black background really is so very difficult.
    I know there is a workaround in setting the iPhone to invert ALL colours (under Accessibility in Settings) but it's a real pain to have to keep altering this setting every time I want to open or close Spotify, and it doesn't look right anyway.  iOS7 is supposed to be a light, bright, easy to read OS - sadly this new Spotify app is the opposite of that.
    Please would Spotify consider adding a simple light or dark theme option, so that those of us who want it can have our much easier to read light background back again, with grey or black text?  It would be a great help to those of us who have eyesight problems.
    If not, I may have to cancel my Spotify Premium account and move to Deezer instead, as I mainly use Spotify when out and about in the car, so am using the iOS app a lot.
    Thank you for considering this plea!
     

  • Report Column as link or normal text based on SQL result

    Hi all,
    I would like to achieve the following:
    I have a report based on a PL/SQL function returning SQL query.
    The first column contains an ID (i.e. a number)
    If this number is contained in a nother table.field this column in this row shall be a link to another page incl. item assignments.
    If this is not the case, it shall be displayed as normal text.
    Example:
    TABLE1.ID = 123456
    IF SELECT count(*) FROM TABLE2 WHERE ID = TABLE1.ID > 1 then
    show column as link
    ELSE
    show column as text
    ENDIF.
    Does anyone have a solution for this?
    Thanks and best regards.
    KMC

    Hi,
    You could achieve that by creating the HTML tags required in the SQL statement itself:
    SELECT ...
    CASE WHEN .... THEN '&lt;a href="f?p=....."&gt;'|| FIELDNAME || '&lt;/a&gt;' ELSE FIELDNAME END FIELDNAME,
    FROM ...Of course, this would mean that the column shouldn't be sortable by the user
    Andy

  • Print JSP/HTML Pages (perhaps PDF?)

    Hi,
    i have a table in HTML generated by JSP.
    Just like the following simple example:
    ...<table>
    <%
    for( Enumeration et = free.getSqlIDs().elements(); et.hasMoreElements();)
    String keyt = (String)et.nextElement();
    Bean b = new Bean();
    b.init(path,DB);
    b.setID(keyt);
    b.restore();
    %>
    <tr>
    <td>
    <%out.print(b.getName());%>
    </td>
    <td>
    <%out.print(b.getAdress());%>
    </td>
    </tr>
    %>
    </table>...
    No i want to give a button to the user. When pressed, the HTML-Page should transform to PDF.
    With such a method i want to print the HTML-Page.
    I Know that this is possible with the help of XML/XSP and a stylesheet. But i like to do that with this way:JavaBeans-->JSP-->HTML-->PDF
    Anyone a solution, some code examples for me?
    Or perhaps another solution to print HTML-Pages in a fine design?
    Thank you for your help
    Andy

    Hi,
    no one any idea?
    How do you print Jsp Pages?
    Thank you
    Bye
    Andy

  • Printing a HTML page in a JTextPane

    Hi all..
    I nned to develop a report generating system for one of the softwares that I am writing and I am planing to generat the report as a HTML page (both text and images) and users can preview them on a JTextPane and can save to disk as html files for further use.
    I also want to add functionality to the application to print the report through java.
    what I want to do is to print what is displayed in JTextPane (Content Type: text/html)
    I am familiour with Printable interface what I cant figure out is how to make the JTextPane printable and how to send the data in JTextPane to printers Graphic object
    Can somebody give a sample code for this.
    Also if you know any other way of printing a HTML formated text without use of any other componant like JTextPane please tel me how to do it.

    We had done the same using the JEditor Pane and later print the JEditorPane using the print API..
    Here is the code to include the html file.
    mainPane = new JEditorPane("file:///C:/project/JavaPrintingAPI/AddGlobalProduct.html");
    mainPane.setEditable(false);If it work... hungry for yummy dukes... :-)

  • From HTML string to HtmlDocument?

    I have a String consists of a HTML string e.g. <br>Hello</br>
    How to convert it into a javax.swing.text.html.HtmlDocument?

    You can't convert any String directly to HTMLDocument !
    HTMLDocument is a back-end of any HTML editor (eg.,JTextPane / JEditorPane).
    If you want to have an HTMLDocument that represent your string "<br>Hello</br>" ,then do one thing. (Your HTML string is still invalid ,cos there is no such TAG called </br>)
    JTextPane text=new JTextPane();
    text.setContentType("text/html");
    text.setText(yourHTMLString);
    HTMLDocument doc= (HTMLDocument)text.getDocument();

Maybe you are looking for

  • Direct Execution of query having Unicode Characters

    Direct Execution of query having Unicode Characters Hi All, In my application I am firing a Select Query having Unicode characters in Where Clause under condition like '%%' to Oracle 10g DB from a Interface written in VC6.0... Application funcational

  • ITunes 7.1.1 not displaying correctly

    Having recently upgraded from 7.0.1 to 7.1.1, the interface is not displaying properly. The icons have disappeared down the left side (for music, movies, podcasts, playlists etc). But my main problem is that the scroll bars have also vanished - which

  • Is There A Bug In 4.3.2?

    I'm just setting here wondering if 4.3.2 has a bug? When i try to sing my iPad with iTunes, The Apps in iTunes 10.2.2 are only showing 16 apps PER page, and my iPad has 20 per page. I can add 4 apps in iTunes, but when i sync it, it will pull the bot

  • Apparent Bug in Saving ACR Presets

    I was experimenting with some Camera Raw presets for a new camera and discovered that when I saved a preset for the Detail panel, some of the values were omitted.  Specifically, the preset did not save the values for Luminous Detail, Luminous Contras

  • :system.form_status

    I am coming into my form and performing enter query and execute query without criteria. I exit the window and receive a message about saving, I did not change anything. I have a status of "N" on the form and the save message only appear when the stat