title: How to increase the size of text that dynamically created in java
body: <p>I have code where it reads the XML file and display. i am able to size of the content for the cells in td, but how to change the size of texts where td cells are dynamically created. Here is the code.</p>
  
  <h2>Code:</h2>
  
  <pre><code>public class ticketcount {
  
      public static void main(String[] args) throws IOException {
          List&lt;ticket&gt; ticketList = new ArrayList&lt;ticket&gt;();
          String content = "";
          String content1 ="&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;TABLE border=3&gt;";
          FileWriter fw =null;
          BufferedWriter bw=null;
          String Path = "src";
          try {
              File fXmlFile = new File(Path + "\\file.xml");
              DocumentBuilderFactory dbFactory = DocumentBuilderFactory
              .newInstance();
              DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
              Document doc = dBuilder.parse(fXmlFile);
              doc.getDocumentElement().normalize();
              NodeList ticketNodeList = doc.getElementsByTagName("ticket");
              for (int temp = 0; temp &lt; ticketNodeList.getLength(); temp++) {
                  Node varNode = ticketNodeList.item(temp);
                  if (varNode.getNodeType() == Node.ELEMENT_NODE) {
                      Element eElement = (Element) varNode;
                      NodeList teamList = eElement.getElementsByTagName("team");
                      NodeList varsionList = eElement.getElementsByTagName("imp");
                      Node teamNode = teamList.item(0);
                      Node impNode = varsionList.item(0);
                      if (teamNode.getNodeType() == Node.ELEMENT_NODE
                          &amp;&amp; impNode.getNodeType() ==
                      Node.ELEMENT_NODE) {
                          Element teamElement = (Element) teamNode;
                          Element impElement = (Element) impNode;
                          ticket ticket = new ticket(
                          teamElement.getTextContent(),
                          impElement.getTextContent());
                          ticketList.add(ticket);
                      }
                  }
                  File file = new File(Path + "\\result1.html");
                  if (!file.exists()) {
                      file.createNewFile();
                  }
                  fw = new FileWriter(file.getAbsoluteFile());
                  bw = new BufferedWriter(fw);
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          Map&lt;ticket, Integer&gt; count = new HashMap&lt;ticket, Integer&gt;();
          for (ticket c : ticketList)
              if (!count.containsKey(c))
                  count.put(c, Collections.frequency(ticketList, c));
              List&lt;String&gt; imps = getimps(count);
              List&lt;String&gt; teams = getteams(count);
              content=content+"&lt;tr&gt;&lt;th&gt;ticket&lt;/th&gt; ";
              for (String s : imps) {
                  content=content+"&lt;th&gt;"+s+"&lt;/th&gt;";
              }
              content=content+"&lt;/tr&gt;";
              System.out.println("---------------------------------");
              for (String m : teams) {
                  System.out.println(m + "\t| " + getNumOfteams(m, imps, count));
                  content = content + "&lt;tr&gt;&lt;td&gt;&lt;font size = 5&gt;" + m + "&lt;/font&gt;&lt;/td&gt;"
                  + getNumOfteams(m, imps, count) + "&lt;/tr&gt;";
              }
              bw.write(content1 + content + "&lt;/TABLE&gt;&lt;/HTML&gt;");
              bw.close();
              Runtime rTime = Runtime.getRuntime();
              String url = Path + "//result1.html";
              // String url = "C:\\Users\\a561922\\Desktop\\TEST.html";//"D:/hi.html";
              String browser = "C:/Program Files/Internet Explorer/iexplore.exe ";
              File htmlFile = new File(url);
              System.out.println(url);
              Desktop.getDesktop().browse(htmlFile.toURI());
              // Process pc = rTime.exec(browser + url);
              // pc.waitFor();
              // Runtime.getRuntime().exec("C:\\Users\\a561922\\Desktop\\TEST.html");
          }
  
          private static List&lt;String&gt; getteams(Map&lt;ticket, Integer&gt; count) {
              List&lt;String&gt; teams = new ArrayList&lt;String&gt;();
              for (Map.Entry&lt;ticket, Integer&gt; ent : count.entrySet())
                  if (!teams.contains(ent.getKey().getteam()))
                      teams.add(ent.getKey().getteam());
                  return teams;
              }
  
              private static String getNumOfteams(String team, List&lt;String&gt; imps,
              Map&lt;ticket, Integer&gt;
              count) {
                  StringBuilder builder = new StringBuilder();
                  for (String v : imps) {
                      Integer cnt = count.get(new ticket(team, v));
                      if (cnt == null) {
                          cnt = 0;
                      }
                      builder.append("&lt;td&gt;"+cnt + "&lt;/td&gt;");
                  }
                  return builder.toString();
              }
  
              private static List&lt;String&gt; getimps(Map&lt;ticket, Integer&gt; count) {
                  List&lt;String&gt; imps = new ArrayList&lt;String&gt;();
                  for (Map.Entry&lt;ticket, Integer&gt; ent : count.entrySet())
                      if (!imps.contains(ent.getKey().getimp()))
                          imps.add(ent.getKey().getimp());
                      return imps;
                  }
              }
  </code></pre>