Is it possible to write an HTML editor using Java?

I have this final year project (for my degree), where I need to use Java to write an HTML editor.
It doesn't have to be fancy or anything, just need to be able to generate HTML files from the GUI frontend where text, images and tables will be created.
I'm new to Java, and I'm having problem with it.
Please help, I only need to know whether it's possible, and possible a little guideline on how to go about it, please?
Terry

http://www.hexidec.com/ekit.php

Similar Messages

  • WebEnterprise - HTML Editors and Java

    I'd like to know any opinions on HTML editors and their use with
    WebEnterprise. Have any of you done
    evaluations to determine the best editor to use with the Forte product? Also,
    do you have experience using
    a Java applet as the front-end to a Forte service object? In this instance,
    are you able to do so with Forte 30f2 and
    WebSDK?
    Thanks,
    Peggy Adrian
    Eli Lilly and Company

    Peggy,
    FrontPage 97 / 98 have both worked really well for us, however we
    discovered a slight hitch with 98 where the Editor would gobble up
    <?FORTE ..> tags inside the SELECT OPTION tag, but you can work around
    that one, apart from this FP98 is a great HTML editor. I also thought
    HotMetal was a good fit.These observations come out of evaluating about
    5-6 leading HTML editors.
    Some recommended steps in the process:
    1) Create a prototype by laying out all the HTML using an Editor. Figure
    out all the navigation within your web. More recent features seen in
    HTML editors such as JavaScript generation and DHTML / CSS support are
    really difficult to work out on your own, let the advanced Editors do as
    much dirty work for you as poss.
    2) Once the prototype is finalized, for all the pages requiring any
    dynamic content generation, figure out all the Tag Handlers you will
    need. Change the HTML Content by inserting the FORTE tags as required,
    code the corresponding Handlers.
    3) Figure out the relation between page requests and the security
    requirements for your pages, design the Session properties and data
    tracing across requests using the Session object.
    4) Do refer to all the Tech Notes on the Forte web site for known
    issues.
    As for the Java applets frontend, we have used Java - IIOP - Forte since
    early beta through every Forte release (3.0.X) and it works fine with
    WebEnterprise and release 30f2.
    - Sameer
    From: Peggy Lynn Adrian <[email protected]>
    Date: Wed, 07 Jan 1998 15:19:58 -0500
    Subject: WebEnterprise - HTML Editors and Java
    I'd like to know any opinions on HTML editors and their use with
    WebEnterprise. Have any of you done
    evaluations to determine the best editor to use with the Forte
    product? Also,
    do you have experience using
    a Java applet as the front-end to a Forte service object? In this
    instance,
    are you able to do so with Forte 30f2 and
    WebSDK?
    Thanks,
    Peggy Adrian
    Eli Lilly and Company

  • I am making a photobook through iPhoto for my Guest Book for guests to sign at my wedding.  I was wondering if it's possible to write on the paper used in the book with ink?  With some photopaper this isn't possible.

    I am making a photobook through iPhoto for my Guest Book for guests to sign at my wedding.  I was wondering if it's possible to write on the paper used in the book with ink?  With some photopaper this isn't possible

    It certainly woujld depend on the pen used - the paper specs are here
    LN

  • Interchage html table using java

    hey all ,
    how can i interchange the row and column of the table which is written inside a HTML file using Java ?
    like if i have html input file like :
    <HTML>
    <BODY>
    <table border="1">
    <tr>
    <th>NAME</th>
    <th>MONDAY</th>
    <th>TUESDAY</th>
    <th>WEDNESDAY</th>
    </tr>
    <tr>
    <td>A</td>
    <td>C++</td>
    <td>C</td>
    <td>Java</td>
    </tr>
    <tr>
    <td>B</td>
    <td>C</td>
    <td>C++</td>
    <td>Java</td>
    </tr>
    <tr>
    <td>C</td>
    <td>Java</td>
    <td>C++</td>
    <td>C</td>
    </tr>
    </table>
    </BODY>
    </HTML> then my java program generate HTML output file like this :
    <HTML>
    <BODY>
    <table border="1">
    <tr>
    <th>NAME</th>
    <th>A</th>
    <th>B</th>
    <th>C</th>
    </tr>
    <tr>
    <td>MONDAY</td>
    <td>C++</td>
    <td>C</td>
    <td>Java</td>
    </tr>
    <tr>
    <td>TUESDAY</td>
    <td>C</td>
    <td>C++</td>
    <td>C++</td>
    </tr>
    <tr>
    <td>WEDNESDAY</td>
    <td>Java</td>
    <td>Java</td>
    <td>C</td>
    </tr>
    </table>
    </BODY>
    </HTML>

    hi all ,
    check out this code wiz , but it will not work when when the 2d string array is not square matrix ...any suggestions to remove this limitation ?
    import java.io.DataInputStream;
    import java.io.FileInputStream;
    import java.io.*;
    public class ParseHTML
         public static void main(String[] args)
              String a[][]=new String[10][10];
              String fName = "test.html"; //input file name
              a=htmlread(fName);
              String b[][]=new String [10][10];
              b=transpose(a);
              htmlwrite(b,fName);
         public static String[][] htmlread(String fName) //this method will read the file and returns a matrix
              String thisLine;
                  String temp[][]=new String[10][10];
                  try
                  FileInputStream fis = new FileInputStream(fName);
                  DataInputStream myInput = new DataInputStream(fis);
                  int i=-1;
                  int j=-1;
                  while ((thisLine = myInput.readLine()) != null)
                   if(thisLine.trim().startsWith("<tr>"))
                        i++;
                        j=-1;
                   if(thisLine.trim().startsWith("<td>"))
                        j++;
                        thisLine=thisLine.replace("<td>","");
                        thisLine=thisLine.replace("</td>","");
                        temp[i][j]=thisLine;
            catch(IOException e)
                   e.printStackTrace();
                   System.out.println("File Not Found");
            return temp;
        public static String[][] transpose(String a[][]) //this method will return a tranpose matrix
             String b[][]=new String[a[0].length][a.length];
             for(int i=0;i<a[0].length;i++)
                  for(int j=0;j<a.length;j++)
                       b[i][j]=a[j];
         return b;
    public static void htmlwrite(String b[][],String fName)
    FileOutputStream fout;
    int i=-1;
    int j=-1;
    int flag=0;     
                   // Open an output stream
              try
              fout = new FileOutputStream ("myfile1.html");     
                   FileInputStream fis = new FileInputStream(fName);
              DataInputStream myInput = new DataInputStream(fis);
              String thisLine;
              while ((thisLine = myInput.readLine()) != null)
                   if(thisLine.trim().startsWith("<tr>"))
                        i++;
                        flag=0;
                   if(thisLine.trim().startsWith("<td>"))
                        j++;
                        if(flag==0)
                             j=0;
                             flag=1;
                        thisLine="<td>"+b[i][j]+"</td>";
                        System.out.println(i+" "+j);
              // Print a line of text
              new PrintStream(fout).println (thisLine);
              // Close our output stream
              fout.close();
              catch (IOException e)
                   System.err.println ("Unable to write to file");
                   System.exit(-1);

  • Possible deadlocks with in-memory database using Java

    I've written a completely in-memory database using the Java API on BDB 4.6 and 4.7 for Windows and Linux (x86). The completely in-memory database means the database content and logs are entirely in-memory and the overflow pages will not be written to a disk file.
    The database environment and the database are configured to be transactional. All database access methods are specified to be auto-commit by setting the transaction argument to null. The environment is configured to be multi-threaded (which is the default when using the Java API).
    When run with a single-threaded client, the application works correctly on both Windows and Linux for BDB 4.6 and 4.7.
    When run with a multi-thread client that uses two thread for the database access, I run into a deadlock inside the call to the Database.delete method about half the time.
    I am assuming that in the "auto-commit" mode, a deadlock should not be possible.
    Any reported problems with using Java with in-memory database?
    Thanks.
    Hisur

    Hi Hisur,
    If you are using transactions and multiple threads, you will have to deal with deadlock. In this particular case, it's likely that a delete is causing two btree pages to be merged (called a "reverse split"). Auto-commit makes no difference in this case -- the application must retry the operation.
    Regards,
    Michael Cahill, Oracle.

  • How to create hyperlink in Html page using Java

    Hello every one
    I want to know that how can I create a hyperlink in Html page using java ?
    Let for example
    I have code like this and i want to give hyperlink to it using java.
    rember that i am creating node using this id="name" which give me multiple value. and i want to assign diff link to each name..?
    <tr>
    <td ><span id="name"></span>
    </tr>

    but i m using this code to create node in html file
    HTMLLIElement li = (HTMLLIElement)appHTML.createElement("LI");
    Text txt = appHTML.createTextNode(name);
    li.appendChild(txt);
    appHTML.getElementById("name").appendChild(li);
    this will display all name value which is coming from database,
    and i want to assign a hyperlink to it,
    I have id with name also so I thought that using id i will
    create javascript like
    function popup(id)
         if(id==1)
              var n1 = window.open("../list/name1.html");
         if(id==2)
              var n1 = window.open("../list/name2.html");
    this way i want to popup particular file if i can pass id value in this function
    so want hyperlink like
    name

  • How to write a messenger with using java?

    May I know how to write a messenger with using java? The messenger need included two functions which are file transfer and add users to join the conversation.
    Thank you.

    Ok, so you need to start from the beginning, the requirements, is it a swing (i.e. GUI) app, web app, console, etc...?
    As stated by sprizor making an IM client is no easy task, you need to both implement the server side and the client side, which both communicate with each other, file transfers are also quite complex, and even maintaining a multi-user chat can be quite difficult.
    If you are after a Web Based app, then you will need to look into Push technologies, like Grizzly Comet which is a nice wrapper for the NIO java stuff:
    https://grizzly.dev.java.net/
    Good luck...

  • Is it possible to make a code editor in Java?

    I'm new to java and so i'd like to know if it would be possible to make a simple code editor for Mobile Phones with Java.
    The code editor will be for GML.
    I'd like to make it so that the code can be easily edited on a wide range Mobile phones (not necissarily smart phones).
    If this is possible, I would greatly appreaciate any help or advice. Thanks.
    skinnyeddy

    TuringPest wrote:
    Hippolyte wrote:
    skinnyeddy wrote:
    "first list the areas in which you are proficient" - I'm not. I thought it would be easy to make a simple text/code editor in java without any experience. That was a bit of a mistake. Looks like I'll have to learn the hard way :SIMHO, one should woodshed it, work on programming basics and object-oriented programming fundamentals, in Java for at least one year before attempting to write any GUI code. Even day in this forum we see what code looks like when this advice is not followed.my first java code 5 years ago was an applet with a changing 2d function being animated.
    it worked after 2 grueling days and i was so happy because visual feedback was my only motivation.
    so its hard to say. granted, my code was awful for a long time.I'm thinking of the guy last week who had Swing+JDBC code and kept pestering for help on an obvious syntax error (he was invoking a method with no arguments when it was defined to take a String array) and for the life of him, he couldn't see the error or understand the error message. Posters kept telling him to learn the fundamentals first, but he was stubborn and kept demanding someone fix his syntax error...

  • Creating a small HTML-Editor using JEditorPane

    Hello! I'm trying to create a small HTML-Editor. Via this editor users shall be capable to create formatted text (bold, italic, underlined, different sizes, different fonts, different colors). Furthermore, if the user pushes the enter-button a new line-break (<br>) shall be inserted. Basically my editor is working but with some big problems:
    1. When I create an instance of my editor, I initialize it with some html-code.
    this.m_EditorPane.setText("<html><head></head><body></body></html>"); Without this initialization between the <body> and </body> <p> and </p> will be inserted, what I don't want. But if I push now the enter-button at the beginning, <br>-tag will not be inserted in the <body>-area but in the <head>-area.
    2. Styling text is working really good, but when I insert a line-break (via enter-button), the <br>-tag is inserted after the (e.g.) closing bold-tag (</b>). So, in the next line, this style-property must be reselected.
    Can anybody help me to change this behavior?
    Kind regards, Stefan
    P.S. The way I insert the <br>-tag:
    JEditorPane editor = getEditor(ae);
    HTMLDocument doc = getHTMLDocument(editor);
    HTMLEditorKit kit = getHTMLEditorKit(editor);
    editor.replaceSelection("");
    int offset = editor.getCaretPosition();
    kit.insertHTML(doc, offset, "<br>", 0, 0, HTML.Tag.BR);
    editor.getCaret().setDot(editor.getCaretPosition());P.P.S. Sorry for my bad english :-/

    Hello! I'm trying to create a small HTML-Editor. Via this editor users shall be capable to create formatted text (bold, italic, underlined, different sizes, different fonts, different colors). Furthermore, if the user pushes the enter-button a new line-break (<br>) shall be inserted. Basically my editor is working but with some big problems:
    1. When I create an instance of my editor, I initialize it with some html-code.
    this.m_EditorPane.setText("<html><head></head><body></body></html>"); Without this initialization between the <body> and </body> <p> and </p> will be inserted, what I don't want. But if I push now the enter-button at the beginning, <br>-tag will not be inserted in the <body>-area but in the <head>-area.
    2. Styling text is working really good, but when I insert a line-break (via enter-button), the <br>-tag is inserted after the (e.g.) closing bold-tag (</b>). So, in the next line, this style-property must be reselected.
    Can anybody help me to change this behavior?
    Kind regards, Stefan
    P.S. The way I insert the <br>-tag:
    JEditorPane editor = getEditor(ae);
    HTMLDocument doc = getHTMLDocument(editor);
    HTMLEditorKit kit = getHTMLEditorKit(editor);
    editor.replaceSelection("");
    int offset = editor.getCaretPosition();
    kit.insertHTML(doc, offset, "<br>", 0, 0, HTML.Tag.BR);
    editor.getCaret().setDot(editor.getCaretPosition());P.P.S. Sorry for my bad english :-/

  • Is it possible to write an operating system in java?

    Our highschool requires us to do a senior project to graduate. It has to be something you want to do as a career. I want to be a programmer so I thought it would be cool if I wrote an operating system. I really don't know where to start though, I thought you couldn't write an operating system in a high-level language at first but then I heard differently. I can see why you'd have to use assembly or someting to write one because it has to be in bionary but i guess that is not true. So is it possible to use java to write an operating system or is that just not possible? I'm only a sophmore right now so i have two years to figure it out but i'd like to get an idea now.
    thanks, lateralus

    it's not going to have a gui or anything like that,
    it's just going to be something similar to DOS. It
    really doesn't have to do much. I just like the
    challenge, also I heard someone else in my school had
    done it and they use java.You sure that you don't just want to write a command shell?
    When you open a console window on windows that is a command shell, not an OS.
    And writing one of those would be a lot easier than writing an OS.
    I suppose you could write a very primitive pseudo OS using the Sun VM. However I am not sure that you would really be able to demonstrate the concepts of an OS except in a very complicated way. For example if you had the following 'OS' commands
    1. Store file
    2. Print file
    Then you could implement it in the following way
    - Create a big binary file managed via java
    - Storing a file means 'managing' a hunk of that binary file and 'mapping' the file into that space.
    - Printing the file would mean
    ....a Get map to access file (so find it in binary file.)
    ....b. Read contents (read bytes from binary file)
    ....c. Print contents to JFrame (or GUI thing)
    If the above seems confusing then unless you have a teacher that is either willing to be very free with what a success is or a teacher that understands the concepts very well then going with a command shell would be much better.

  • How Do I write an XML file using Java?

    Hello there!! to everyone reading my post.
    I have this project I need to do, and I have no clue where to start, I was wondering if you guys could help me out.
    I need to know how to write an XML file using a Java Program, but without using a Third party library.... just using java native APIs.
    I will probably take the values to construct the file from a form.
    I will certainly appreciate if you could post some sample code for me.
    Thank you very much in advance..

    Hello there!,
    I have some doubts about the Tutorial I am currently reading. correct me If I'm wrong, but the section "Write a simple XML file" teaches you how to do so using a text editor. I need to create my XML file from a running Java Program written by myself, that takes the values to build it from some variables.
    If I'm totally wrong about what I'm saying, could you please point me to where I can find the information of how to do what I'm asking for, inside the tutorial.
    Thank you very much,...
    sincerely.

  • Print Html page Using Java

    I need to print Html Page into my printer, how can I do this. Any help will be appreciated.
    Wil

    File > Print.
    See: http://java.sun.com/javase/6/docs/technotes/guides/jps/spec/printing2d.fm.html
    And:
    http://java.sun.com/j2se/1.4.2/docs/guide/jps/index.html
    And google "Java JPS"

  • How to write as XML file using java 1.5

    hi all,
    i am trying to create an XML file using java 1.5. I took a XML creating java file which was working with java 1.4 and ported same file into java 1.5 with changes according to the SAX and DOM implmentation in java 1.5 and tried to compile. But while writing as a file it throws error "cannot find the symbol."
    can any body help me out to solve this issue.......
    thankx in advance
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.NamedNodeMap;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.DocumentHandler;
    import org.xml.sax.InputSource;
    import org.xml.sax.helpers.ParserFactory;
    import java.io.*;
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                   
                   dbf.setNamespaceAware(true);
    DocumentBuilder db = dbf.newDocumentBuilder();                   
    Document xmlDoc =  db.newDocument();
    // this creates the xml document ref
    // parent node reference
    Element rootnd = (Element) xmlDoc.createElement("ALL_TABLES");
    // root node
    xmlDoc.appendChild(rootnd);
    Element rownd = (Element) xmlDoc.createElement("ROW");
    rootnd.appendChild(rownd);
    Element statusnd = (Element) xmlDoc.createElement("FILE_STATUS");
    rownd.appendChild(statusnd);
    statusnd.appendChild(xmlDoc.createTextNode("Y")
    FileOutputStream outpt = new FileOutputStream(outdir + "//forbranch.xml");
    Writer outf = new OutputStreamWriter(outpt, "UTF-8");
    //error is occuring here Since write method is not available in the Document class
    xmlDoc.write(outf);
    outf.flush();

    Hi,
    when I look in the JDK1.4.2 specification I don't see any write method in the Document interface.
    However, your solution is the Transformer class. There you transform your DOM tree into any output you need. Your code sould look something like this:     TransformerFactory tf = TransformerFactory.newInstance();
         // set all necessary features for your transformer -> see OutputKeys
         Transformer t = tf.newTransformer();
         t.transform(new DOMSource(xmlDoc), new StreamResult(file));Then you have your XML file stored in the file system.
    Hope it helps.

  • Edit HTML File using java

    Hi....
    I have a report in HTML format and a list of thresholds in txt format.
    Now, using java how can I:
    1. Compare the values in the report with the thresholds
    2. Edit the report such that values over the thresholds are highlighted in say, red colour.
    I am new to Java programming, so java jargons won't be of much help. I read about jeditorpane but it's primary use is to display html file(that is what i inferred). Is their a way in which i could accomplish the above using jeditorpane??....how do i do the comparison part??

    srgsoroka wrote:
    Did you check http://jtidy.sourceforge.net/.
    From site:
    "JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty printer. Like its non-Java cousin, JTidy can be used as a tool for cleaning up malformed and faulty HTML. In addition, JTidy provides a DOM interface to the document that is being processed, which effectively makes you able to use JTidy as a DOM parser for real-world HTML."Yes, I did. But I don't need a syntax checker.The syntax is alright. I want to modify the HTML code after comparison with a txt document.As far as DOM parser is concerned, I googled the term but didn't understand much of it..:-(...If you could explain it in layman's terms........

  • How to submit a html form using java

    hi friends,
    i have a html form with some input fields, when ever a user submit the form the user information is stored in the database. is it possible to pass the user information in the url(url rewriting) and submit it by a java program so that the data will be stored in the database, as like as, user submit it manually.
    for eg:
    /*sample.html*/
    <form action="store.jsp" method="post">
    User Data:<input type="text" name="userdata">
    <input type="submit">
    </form>
    in my java is it possible to store the record as below:
    URL url=new URL("http://localhost:7001/webapp/store.jsp?userdata=AutomaticDatasave");
    URLConnection con=url.openConnection();
    int i=0;
    while((i=con.getInputStream().read())!=-1)
    System.out.print(i);/*it has to print the data that store.jsp is returned like information stored or error storing data(what ever)*/
    }Edited by: rajaram on Oct 27, 2007 1:01 AM

    hi Drclap,
    Thanks for your reply, which is helpful to me....
    tried what you said, what i did is modified the code like below
    con.setDoOutput(true);
    BufferedWriter br=new BufferedWriter(new InputStreamWriter(con.getOutputStream()));
    String str="userdata=AutomateDataSave\n";
    br.write(str,0,str.length());
    br.flush()But
    Iam Getting Internal Server Error
    Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL
    Edited by: rajaram on Oct 27, 2007 1:24 AM

Maybe you are looking for