{"id":26856,"date":"2021-05-03T23:10:05","date_gmt":"2021-05-04T03:10:05","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/dom-example-that-represents-the-basic-structure-of-an-xml-document-as-a-jtree-programming-code-examples-java-j2ee-j2me-javascript\/"},"modified":"2021-05-03T23:10:05","modified_gmt":"2021-05-04T03:10:05","slug":"dom-example-that-represents-the-basic-structure-of-an-xml-document-as-a-jtree-programming-code-examples-java-j2ee-j2me-javascript","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=26856","title":{"rendered":"DOM example that represents the basic structure of an XML document as a JTree #Programming Code Examples #Java\/J2EE\/J2ME #JavaScript"},"content":{"rendered":"<pre>\n\/\/XMLTree.java\n\/\/Uses the following files\n\nUses the following files:\n\n    * XMLFrame.java:Swing application to select an XML document and display in a JTree.\n\nExtensionFileFilter.java Allows you to specify which file extensions will be displayed in a JFileChooser.\n\ntest.xml Default file loaded if none selected by user. \n\nperennials.xml and perennials.dtd Data on daylilies and corresponding DTD.\n\nWindowUtilities.java  \n\nExitListener.java. \n\n\/\/XMLTree.java as follows\nimport java.awt.*;\nimport javax.swing.*;\nimport javax.swing.tree.*;\nimport java.io.*;\nimport org.w3c.dom.*;\nimport javax.xml.parsers.*;\n\n\/** Given a filename or a name and an input stream,\n *  this class generates a JTree representing the\n *  XML structure contained in the file or stream.\n *  Parses with DOM then copies the tree structure\n *  (minus text and comment nodes).\n *\n *  Taken from Core Web Programming from \n *  Prentice Hall and Sun Microsystems Press,\n *  \n *  &copy; 2001 Marty Hall and Larry Brown;\n *  may be freely used or adapted. \n *\/\n\npublic class XMLTree extends JTree {\n  public XMLTree(String filename) throws IOException {\n    this(filename, new FileInputStream(new File(filename)));\n  }\n\n  public XMLTree(String filename, InputStream in) {\n    super(makeRootNode(in));\n  }\n\n  \/\/ This method needs to be static so that it can be called\n  \/\/ from the call to the parent constructor (super), which\n  \/\/ occurs before the object is really built.\n  \n  private static DefaultMutableTreeNode\n                                 makeRootNode(InputStream in) {\n    try {\n      \/\/ Use JAXP's DocumentBuilderFactory so that there\n      \/\/ is no code here that is dependent on a particular\n      \/\/ DOM parser. Use the system property\n      \/\/ javax.xml.parsers.DocumentBuilderFactory (set either\n      \/\/ from Java code or by using the -D option to &quot;java&quot;).\n      \/\/ or jre_dir\/lib\/jaxp.properties to specify this.\n      DocumentBuilderFactory builderFactory =\n        DocumentBuilderFactory.newInstance();\n      DocumentBuilder builder =\n        builderFactory.newDocumentBuilder();\n      \/\/ Standard DOM code from hereon. The &quot;parse&quot;\n      \/\/ method invokes the parser and returns a fully parsed\n      \/\/ Document object. We'll then recursively descend the\n      \/\/ tree and copy non-text nodes into JTree nodes.\n      Document document = builder.parse(in);\n      document.getDocumentElement().normalize();\n      Element rootElement = document.getDocumentElement();\n      DefaultMutableTreeNode rootTreeNode =\n        buildTree(rootElement);\n      return(rootTreeNode);\n    } catch(Exception e) {\n      String errorMessage =\n        &quot;Error making root node: &quot; + e;\n      System.err.println(errorMessage);\n      e.printStackTrace();\n      return(new DefaultMutableTreeNode(errorMessage));\n    }\n  }\n\n  private static DefaultMutableTreeNode\n                              buildTree(Element rootElement) {\n    \/\/ Make a JTree node for the root, then make JTree\n    \/\/ nodes for each child and add them to the root node.\n    \/\/ The addChildren method is recursive.\n    DefaultMutableTreeNode rootTreeNode =\n      new DefaultMutableTreeNode(treeNodeLabel(rootElement));\n    addChildren(rootTreeNode, rootElement);\n    return(rootTreeNode);\n  }\n\n  private static void addChildren\n                       (DefaultMutableTreeNode parentTreeNode,\n                        Node parentXMLElement) {\n    \/\/ Recursive method that finds all the child elements\n    \/\/ and adds them to the parent node. We have two types\n    \/\/ of nodes here: the ones corresponding to the actual\n    \/\/ XML structure and the entries of the graphical JTree.\n    \/\/ The convention is that nodes corresponding to the\n    \/\/ graphical JTree will have the word &quot;tree&quot; in the\n    \/\/ variable name. Thus, &quot;childElement&quot; is the child XML\n    \/\/ element whereas &quot;childTreeNode&quot; is the JTree element.\n    \/\/ This method just copies the non-text and non-comment\n    \/\/ nodes from the XML structure to the JTree structure.\n    \n    NodeList childElements =\n      parentXMLElement.getChildNodes();\n    for(int i=0; i&lt;childelements .getLength(); i++) {\n      Node childElement = childElements.item(i);\n      if (!(childElement instanceof Text ||\n            childElement instanceof Comment)) {\n        DefaultMutableTreeNode childTreeNode =\n          new DefaultMutableTreeNode\n            (treeNodeLabel(childElement));\n        parentTreeNode.add(childTreeNode);\n        addChildren(childTreeNode, childElement);\n      }\n    }\n  }\n\n  \/\/ If the XML element has no attributes, the JTree node\n  \/\/ will just have the name of the XML element. If the\n  \/\/ XML element has attributes, the names and values of the\n  \/\/ attributes will be listed in parens after the XML\n  \/\/ element name. For example:\n  \/\/ XML Element: \n  \/\/ JTree Node:  blah\n  \/\/ XML Element: \n  \/\/ JTree Node:  blah (foo=bar, baz=quux)\n\n  private static String treeNodeLabel(Node childElement) {\n    NamedNodeMap elementAttributes =\n      childElement.getAttributes();\n    String treeNodeLabel = childElement.getNodeName();\n    if (elementAttributes != null &amp;&amp;\n        elementAttributes.getLength() &gt; 0) {\n      treeNodeLabel = treeNodeLabel + &quot; (&quot;;\n      int numAttributes = elementAttributes.getLength();\n      for(int i=0; i 0) {\n          treeNodeLabel = treeNodeLabel + &quot;, &quot;;\n        }\n        treeNodeLabel =\n          treeNodeLabel + attribute.getNodeName() +\n          &quot;=&quot; + attribute.getNodeValue();\n      }\n      treeNodeLabel = treeNodeLabel + &quot;)&quot;;\n    }\n    return(treeNodeLabel);\n  }\n}\n<\/pre>\n<p><b>XMLFrame.java Swing application to select an XML document and display in a JTree. <\/b><\/p>\n<pre>\nimport java.awt.*;\nimport javax.swing.*;\nimport java.io.*;\n\n\/** Invokes an XML parser on an XML document and displays\n *  the document in a JTree. Both the parser and the\n *  document can be specified by the user. The parser\n *  is specified by invoking the program with\n *  java -Djavax.xml.parsers.DocumentBuilderFactory=xxx XMLFrame\n *  If no parser is specified, the Apache Xerces parser is used.\n *  The XML document can be supplied on the command\n *  line, but if it is not given, a JFileChooser is used\n *  to interactively select the file of interest.\n *\n *  Taken from Core Web Programming from \n *  Prentice Hall and Sun Microsystems Press,\n \n *  &copy; 2001 Marty Hall and Larry Brown;\n *  may be freely used or adapted. \n *\/\n\npublic class XMLFrame extends JFrame {\n  public static void main(String[] args) {\n    String jaxpPropertyName =\n      &quot;javax.xml.parsers.DocumentBuilderFactory&quot;;\n    \/\/ Pass the parser factory in on the command line with\n    \/\/ -D to override the use of the Apache parser.\n    if (System.getProperty(jaxpPropertyName) == null) {\n      String apacheXercesPropertyValue =\n        &quot;org.apache.xerces.jaxp.DocumentBuilderFactoryImpl&quot;;\n      System.setProperty(jaxpPropertyName,\n                         apacheXercesPropertyValue);\n    }\n    String filename;\n    if (args.length &gt; 0) {\n      filename = args[0];\n    } else {\n      String[] extensions = { &quot;xml&quot;, &quot;tld&quot; };\n      WindowUtilities.setNativeLookAndFeel();\n      filename = ExtensionFileFilter.getFileName(&quot;.&quot;,\n                                                 &quot;XML Files&quot;,\n                                                 extensions);\n      if (filename == null) {\n        filename = &quot;test.xml&quot;;\n      }\n    }\n    new XMLFrame(filename);\n  }\n\n  public XMLFrame(String filename) {\n    try {\n      WindowUtilities.setNativeLookAndFeel();\n      JTree tree = new XMLTree(filename);\n      JFrame frame = new JFrame(filename);\n      frame.addWindowListener(new ExitListener());\n      Container content = frame.getContentPane();\n      content.add(new JScrollPane(tree));\n      frame.pack();\n      frame.setVisible(true);\n    } catch(IOException ioe) {\n      System.out.println(&quot;Error creating tree: &quot; + ioe);\n    }\n  }\n}\n<\/pre>\n<p><b>ExtensionFileFilter.java  Allows you to specify which file extensions will be displayed in a JFileChooser. <\/b><\/p>\n<pre>\nimport java.io.File;\nimport java.util.*;\nimport javax.swing.*;\nimport javax.swing.filechooser.FileFilter;\n\n\/** A FileFilter that lets you specify which file extensions \n *  will be displayed. Also includes a static getFileName \n *  method that users can call to pop up a JFileChooser for \n *  a set of file extensions.\n *  <p>\n *  Adapted from Sun SwingSet demo.\n *\n *  Taken from Core Web Programming from \n *  Prentice Hall and Sun Microsystems Press,\n *  &copy; 2001 Marty Hall and Larry Brown;\n *  may be freely used or adapted. \n *\/\n\npublic class ExtensionFileFilter extends FileFilter {\n  public static final int LOAD = 0;\n  public static final int SAVE = 1;\n  private String description;\n  private boolean allowDirectories;\n  private Hashtable extensionsTable = new Hashtable();\n  private boolean allowAll = false;\n\n  public ExtensionFileFilter(boolean allowDirectories) {\n    this.allowDirectories = allowDirectories;\n  }\n\n  public ExtensionFileFilter() {\n    this(true);\n  }\n  \n  \n  public static String getFileName(String initialDirectory,\n                                   String description,\n                                   String extension) {\n    String[] extensions = new String[]{ extension };\n    return(getFileName(initialDirectory, description, \n                       extensions, LOAD));\n  }  \n\n  public static String getFileName(String initialDirectory,\n                                   String description,\n                                   String extension,\n                                   int mode) {\n    String[] extensions = new String[]{ extension };\n    return(getFileName(initialDirectory, description, \n                       extensions, mode));\n  }\n\n  public static String getFileName(String initialDirectory,\n                                   String description,\n                                   String[] extensions) {\n    return(getFileName(initialDirectory, description, \n                       extensions, LOAD));\n  }\n\n\n  \/** Pops up a JFileChooser that lists files with the \n   *  specified extensions. If the mode is SAVE, then the \n   *  dialog will have a Save button; otherwise, the dialog \n   *  will have an Open button. Returns a String corresponding\n   *  to the file's pathname, or null if Cancel was selected.\n   *\/\n\n  public static String getFileName(String initialDirectory,\n                                   String description,\n                                   String[] extensions,\n                                   int mode) {\n    ExtensionFileFilter filter = new ExtensionFileFilter();\n    filter.setDescription(description);\n    for(int i=0; i&lt;extensions .length; i++) {\n      String extension = extensions[i];\n      filter.addExtension(extension, true);\n    }\n    JFileChooser chooser =\n      new JFileChooser(initialDirectory);\n    chooser.setFileFilter(filter);\n    int selectVal = (mode==SAVE) ? chooser.showSaveDialog(null)\n                                 : chooser.showOpenDialog(null);\n    if (selectVal == JFileChooser.APPROVE_OPTION) {\n      String path = chooser.getSelectedFile().getAbsolutePath();\n      return(path);\n    } else {\n      JOptionPane.showMessageDialog(null, &quot;No file selected.&quot;);\n      return(null);\n    }\n  }\n\n  public void addExtension(String extension,\n                           boolean caseInsensitive) {\n    if (caseInsensitive) {\n      extension = extension.toLowerCase();\n    }\n    if (!extensionsTable.containsKey(extension)) {\n      extensionsTable.put(extension,\n                          new Boolean(caseInsensitive));\n      if (extension.equals(&quot;*&quot;) ||\n          extension.equals(&quot;*.*&quot;) ||\n          extension.equals(&quot;.*&quot;)) {\n        allowAll = true;\n      }\n    }\n  }\n\n  public boolean accept(File file) {\n    if (file.isDirectory()) {\n      return(allowDirectories);\n    }\n    if (allowAll) {\n      return(true);\n    }\n    String name = file.getName();\n    int dotIndex = name.lastIndexOf(&#039;.&#039;);\n    if ((dotIndex == -1) || (dotIndex == name.length() - 1)) {\n      return(false);\n    }\n    String extension = name.substring(dotIndex + 1);\n    if (extensionsTable.containsKey(extension)) {\n      return(true);\n    }\n    Enumeration keys = extensionsTable.keys();\n    while(keys.hasMoreElements()) {\n      String possibleExtension = (String)keys.nextElement();\n      Boolean caseFlag =\n        (Boolean)extensionsTable.get(possibleExtension);\n      if ((caseFlag != null) &amp;&amp;\n          (caseFlag.equals(Boolean.FALSE)) &amp;&amp;\n          (possibleExtension.equalsIgnoreCase(extension))) {\n        return(true);\n      }\n    }\n    return(false);\n  }\n\n  public void setDescription(String description) {\n    this.description = description;\n  }\n\n  public String getDescription() {\n    return(description);\n  }\n}\n<\/p><\/pre>\n<p><b>WindowUtilities.java<\/b><\/p>\n<pre>\nimport javax.swing.*;\nimport java.awt.*;   \/\/ For Color and Container classes.\n\n\/** A few utilities that simplify using windows in Swing. \n *\n *  Taken from Core Web Programming from \n *  Prentice Hall and Sun Microsystems Press,\n * \n *  &copy; 2001 Marty Hall and Larry Brown;\n *  may be freely used or adapted.\n *\/\n\npublic class WindowUtilities {\n\n  \/** Tell system to use native look and feel, as in previous\n   *  releases. Metal (Java) LAF is the default otherwise.\n   *\/\n\n  public static void setNativeLookAndFeel() {\n    try {\n     UIManager.setLookAndFeel(\n       UIManager.getSystemLookAndFeelClassName());\n    } catch(Exception e) {\n      System.out.println(&quot;Error setting native LAF: &quot; + e);\n    }\n  }\n\n  public static void setJavaLookAndFeel() {\n    try {\n     UIManager.setLookAndFeel(\n       UIManager.getCrossPlatformLookAndFeelClassName());\n    } catch(Exception e) {\n      System.out.println(&quot;Error setting Java LAF: &quot; + e);\n    }\n  }\n\n   public static void setMotifLookAndFeel() {\n    try {\n      UIManager.setLookAndFeel(\n        &quot;com.sun.java.swing.plaf.motif.MotifLookAndFeel&quot;);\n    } catch(Exception e) {\n      System.out.println(&quot;Error setting Motif LAF: &quot; + e);\n    }\n  }\n\n  \/** A simplified way to see a JPanel or other Container. Pops\n   *  up a JFrame with specified Container as the content pane.\n   *\/\n\n  public static JFrame openInJFrame(Container content,\n                                    int width,\n                                    int height,\n                                    String title,\n                                    Color bgColor) {\n    JFrame frame = new JFrame(title);\n    frame.setBackground(bgColor);\n    content.setBackground(bgColor);\n    frame.setSize(width, height);\n    frame.setContentPane(content);\n    frame.addWindowListener(new ExitListener());\n    frame.setVisible(true);\n    return(frame);\n  }\n\n  \/** Uses Color.white as the background color. *\/\n\n  public static JFrame openInJFrame(Container content,\n                                    int width,\n                                    int height,\n                                    String title) {\n    return(openInJFrame(content, width, height,\n                        title, Color.white));\n  }\n\n  \/** Uses Color.white as the background color, and the\n   *  name of the Container's class as the JFrame title.\n   *\/\n\n  public static JFrame openInJFrame(Container content,\n                                    int width,\n                                    int height) {\n    return(openInJFrame(content, width, height,\n                        content.getClass().getName(),\n                        Color.white));\n  }\n}\n<\/pre>\n<p><b>EXITListener.java<\/b><\/p>\n<pre>\nimport java.awt.*;\nimport java.awt.event.*;\n\n\/** A listener that you attach to the top-level JFrame of\n *  your application, so that quitting the frame exits the \n *  application.\n *\n *  Taken from Core Web Programming from \n *  Prentice Hall and Sun Microsystems Press,\n *  \n *  &copy; 2001 Marty Hall and Larry Brown;\n *  may be freely used or adapted. \n *\/\npublic class ExitListener extends WindowAdapter {\n  public void windowClosing(WindowEvent event) {\n    System.exit(0);\n  }\n}\n<\/pre>\n<p>Note: Brought from our old site: http:\/\/www.salearningschool.com\/example_codes\/ on Jan 2nd, 2017 From: http:\/\/sitestree.com\/?p=10199<br \/> Categories:Programming Code Examples, Java\/J2EE\/J2ME, JavaScript<br \/>Tags:Java\/J2EE\/J2MEJavaScript<br \/> Post Data:2017-01-02 16:04:23<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/XMLTree.java \/\/Uses the following files Uses the following files: * XMLFrame.java:Swing application to select an XML document and display in a JTree. ExtensionFileFilter.java Allows you to specify which file extensions will be displayed in a JFileChooser. test.xml Default file loaded if none selected by user. perennials.xml and perennials.dtd Data on daylilies and corresponding DTD. WindowUtilities.java &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=26856\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-26856","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10245,"url":"http:\/\/bangla.sitestree.com\/?p=10245","url_meta":{"origin":26856,"position":0},"title":"DOM example that represents the basic structure of an XML document as a JTree","author":"","date":"August 25, 2015","format":false,"excerpt":"\/\/XMLTree.java \/\/Uses the following files Uses the following files: \u00a0\u00a0\u00a0 * XMLFrame.java:Swing application to select an XML document and display in a JTree. ExtensionFileFilter.java Allows you to specify which file extensions will be displayed in a JFileChooser. test.xml Default file loaded if none selected by user. perennials.xml and perennials.dtd Data\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":23184,"url":"http:\/\/bangla.sitestree.com\/?p=23184","url_meta":{"origin":26856,"position":1},"title":"Creating Custom Tags in JSP #Root #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"March 26, 2021","format":false,"excerpt":"By Sayed, January 13th, 2008 [use large font in IE\/Firefox] How to create custom tags in JSP? You can create custom tags in JSP. Steps: ----- 1. You have to create a Java file that will define the operation of the custom tag 2. For the Java file, you have\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6455,"url":"http:\/\/bangla.sitestree.com\/?p=6455","url_meta":{"origin":26856,"position":2},"title":"ASP.NET \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 :[\u09aa\u09b0\u09cd\u09ac\u0983 \u09e7\u09e9]:: ASP.NET Web Forms \u09a6\u09bf\u09df\u09c7 XML File \u09a4\u09c8\u09b0\u09c0 \u0995\u09b0\u09c7 \u09b2\u09bf\u09b8\u09cd\u099f \u0995\u09a8\u099f\u09cd\u09b0\u09cb\u09b2","author":"Author-Check- Article-or-Video","date":"February 21, 2015","format":false,"excerpt":"ASP.NET \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 :[\u09aa\u09b0\u09cd\u09ac\u0983 \u09e7\u09e9]:: ASP.NET Web Forms \u09a6\u09bf\u09df\u09c7 XML File \u09a4\u09c8\u09b0\u09c0 \u0995\u09b0\u09c7 \u09b2\u09bf\u09b8\u09cd\u099f \u0995\u09a8\u099f\u09cd\u09b0\u09cb\u09b2 \u09b2\u09c7\u0996\u0995\u0983 \u09ae\u09cb\u09b8\u09cd\u09a4\u09be\u09ab\u09bf\u099c\u09c1\u09b0 \u09ab\u09bf\u09b0\u09cb\u099c \u0964 \u0997\u09a4 \u09aa\u09b0\u09cd\u09ac\u09c7 \u0986\u09ae\u09b0\u09be ASP.NET Web Forms \u098f\u09b0 \u09aa\u09cb\u09b2 \u09b2\u09bf\u09b8\u09cd\u099f\u09c7 SortedList Object \u098f\u09b0 \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u09b6\u09bf\u0996\u09c7\u099b\u09bf\u09b2\u09be\u09ae \u0964 \u0986\u099c \u0986\u09ae\u09b0\u09be \u09b6\u09bf\u0996\u09ac\u09cb \u0995\u09bf\u09ad\u09be\u09ac\u09c7 ASP.NET Web Forms \u09a6\u09bf\u09df\u09c7 XML File \u09ac\u09be\u0987\u09a8\u09cd\u09a1 \u0995\u09b0\u09c7 \u09b2\u09bf\u09b8\u09cd\u099f \u0995\u09a8\u099f\u09cd\u09b0\u09cb\u09b2 \u0995\u09b0\u09be \u09af\u09be\u09df \u0964\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69276,"url":"http:\/\/bangla.sitestree.com\/?p=69276","url_meta":{"origin":26856,"position":3},"title":"Creating Custom Tags in JSP #37","author":"Author-Check- Article-or-Video","date":"August 16, 2021","format":false,"excerpt":"How to create custom tags in JSP?You can create custom tags in JSP. Steps:-----1. You have to create a Java file that will define the operation of the custom tag2. For the Java file, you have to extend javax.servlet.jsp.tagext.BodyTagSupport class3. in your implementation, you have to override (re-write) doStartTag(), doEndTag(),\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10402,"url":"http:\/\/bangla.sitestree.com\/?p=10402","url_meta":{"origin":26856,"position":4},"title":"Demonstrates using a TexturePaint to fill an shape with a tiled image","author":"","date":"August 28, 2015","format":false,"excerpt":"^^^^^^^^^^^^^^^^^ TiledImages.java Demonstrates using a TexturePaint to fill an shape with a tiled image. Uses the following class and images: \u00a0\u00a0\u00a0 * ImageUtilities.java Simplifies creating a BufferedImage from an image file. ~~~~~~~~~~~~~~~~~~ import javax.swing.*; import java.awt.*; import java.awt.geom.*; import java.awt.image.*; \/** An example of using TexturePaint to fill objects with\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10343,"url":"http:\/\/bangla.sitestree.com\/?p=10343","url_meta":{"origin":26856,"position":5},"title":"Uses a FileDialog to choose the file to display","author":"","date":"August 27, 2015","format":false,"excerpt":"DisplayFile.java **************** import java.awt.*; import java.awt.event.*; import java.io.*; \/** Uses a FileDialog to choose the file to display. \u00a0*************** \u00a0 public class DisplayFile extends CloseableFrame \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 implements ActionListener { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 public static void main(String[] args) { \u00a0\u00a0\u00a0 new DisplayFile(); \u00a0 } \u00a0 private Button loadButton; \u00a0 private TextArea\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/26856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26856"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/26856\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26856"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}