aspose file tools
The moose likes Applets and the fly likes Html tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Html tag" Watch "Html tag" New topic
Author

Html tag

siraj siddiqui
Greenhorn

Joined: Dec 05, 2008
Posts: 11
hi friends,
I want to know , Can we add an html tag from applet to the html file in which applete is
is running ? If yes , then how ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32421
If by "html tag" you mean the actual <HTML> tag, then no - the page already has one, and it can't have more than one. If you mean any HTML tag, then you should check out the Common DOM API, which allows applets to access and manipulate the page's DOM.


Android appsImageJ pluginsJava web charts
siraj siddiqui
Greenhorn

Joined: Dec 05, 2008
Posts: 11
In jdk following class is there

public static class HTMLEditorKit.InsertHTMLTextAction
extends HTMLEditorKit.HTMLTextAction

it says

InsertHTMLTextAction can be used to insert an arbitrary string of HTML into an existing HTML document. At least two HTML.Tags need to be supplied. The first Tag, parentTag, identifies the parent in the document to add the elements to. The second tag, addTag, identifies the first tag that should be added to the document as seen in the HTML string. One important thing to remember, is that the parser is going to generate all the appropriate tags, even if they aren't in the HTML string passed in.

For example, lets say you wanted to create an action to insert a table into the body. The parentTag would be HTML.Tag.BODY, addTag would be HTML.Tag.TABLE, and the string could be something like
.

There is also an option to supply an alternate parentTag and addTag. These will be checked for if there is no parentTag at offset.

I do not understand this , will you explain ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32421
This class is not used for accessing the surrounding web page in an applet. Given that, is it still what you want to ask, even if it has nothing to do with applets?
siraj siddiqui
Greenhorn

Joined: Dec 05, 2008
Posts: 11
Can you provide any sample code or tutorial for this class HTMLEditorKit.InsertHTMLTextAction ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32421
Again, that class would not be used for what you describe. If you told us what you're really trying to do we could better help you.
Gauri Patil
Greenhorn

Joined: Mar 19, 2010
Posts: 2
Obviously not, You canot add APPLET to HTML file,because platfrom for APPLET is JAVA
 
 
subject: Html tag
 
developer file tools