HTML: getAllAttributeKeys() : HTML « javax.swing.text.html « Java by API






HTML: getAllAttributeKeys()

  
import javax.swing.text.html.HTML;

public class Main {
  public static void main(String[] args) {

    HTML.Tag[] tags = HTML.getAllTags();
    HTML.Attribute[] attrs = HTML.getAllAttributeKeys();

    System.out.println("HTML Tags:");
    for (int i = 0; i < tags.length - 1; i++) {
      System.out.print(tags[i] + ", ");
      if ((i % 8) == 7) {
        System.out.println("");
      }
    }
    System.out.println(tags[tags.length - 1]);

    System.out.println("\n\nHTML Attributes:");
    for (int i = 0; i < attrs.length - 1; i++) {
      System.out.print(attrs[i] + ", ");
      if ((i % 8) == 7) {
        System.out.println("");
      }
    }
    System.out.println(attrs[attrs.length - 1]);
  }
}

   
    
  








Related examples in the same category

1.HTML.Attribute.HREF
2.HTML.Tag
3.HTML.Tag.A
4.HTML.Tag.CONTENT
5.HTML.Tag.H1
6.HTML: Tag[] getAllTags()