Help save net neutrality! Learn more.

reusing JaxeApplet

  • jbrekle

    jbrekle - 2012-04-28


    your software looks promising, however I encountered some problems. I want to setup the JaxeApplet as an editor for a CMS/Wiki.

    what do the parameters mean? for testing i replaced them with String constants
            cheminConfig = "../config/XHTML_config.xml";
            fichierAEditer = "file:../config/XHTML_config.xml";
            String sNouveau = "abc";
            cheminDictionnaire = "a";
            cheminPhonetique = "b";
            scriptEnregistrement = "c";
            nouveau = sNouveau != null && !"".equals(sNouveau) && "oui".equals(sNouveau);
            editing = false;

    I already found out that cheminConfig is the config file and fichierAEditer the file to display/edit.
    I dont understand why you work with paths there. i would like to pass the document directly as a string parameter.

    when i run the code, i get a
    at jaxe.JaxeElement.creer(
    at jaxe.JaxeDocument.creerEnfantDuDocument(
    at jaxe.JaxeDocument.setDOMDoc(
    at jaxe.JaxeDocument.lire(
    at jaxeapplet.JaxeAppletFrame.<init>(
    at jaxeapplet.JaxeApplet.editerFichier(
    at jaxeapplet.JaxeApplet.start(

    I also tried the suggested minimal example from :
                     JFrame frame = new JFrame();
    JaxeDocument jaxeDoc = new JaxeDocument("config/XHTML_config.xml");
    JaxeTextPane jaxeTextPane = new JaxeTextPane(jaxeDoc, frame);
    URL xmlFileURL;
    try {
    xmlFileURL = new URL("");
    } catch (MalformedURLException e) {
    when i start it, it says "keine Konfigurationsdatei gefunden für config" (in english "No configuration file found for config"). what does that mean?

    its really sad thats the code is written in french, making it almost impossible to understand it.

  • Damien Guillaume

    I have not created a real documentation about it yet. The parameters are explained in French in I will translate it into English here :

    - config : path to Jaxe's configuration file based on the HTML file
    - fichier : URL for the XML file
    - nouveau : "oui" if it's a new file, "non", if the file already exists
    - dictionnaire : path to the .dico file, relative to the HTML file (optional)
    - phonetique : path to the .phon file, relative to the HTML file (optional)
    - enregistrement : URL the content will be sent to with a POST query whenever the file is saved (relative to the HTML file), (mandatory if the fichier parameter is used)

    There are 2 ways to use the applet :
    - with the parameters fichier and enregistrement, without Javascript.
    In this case, the file will be read from the URL specified in fichier, and saved with the script given by the parameter enregistrement (POST request, parameters chemin (path) and contenu (contents)).
    - with Javascript by using the editer() method to define the XML, getEditing() regularly to wait for the end of the edition, and getTexte() to get the XML contents.

    If you want to send the XML as a String with Javascript, you can use the following code (it uses an HTML form to read or write the XML) :

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <title>Test for an applet controlled with Javascript</title>
    <script type="text/javascript">
    function verif() {
        if (document.applets['jaxe'].getEditing())
            setTimeout('verif()', 500);
        else {
            texte = document.applets['jaxe'].getTexte();
            if (texte != null)
                document.formulaire.texte.value = texte;
    function editer() {
        document.formulaire.texte.readOnly = true;
        setTimeout('verif()', 500);
    <h1>Test for an applet controlled with Javascript</h1>
    <form name="formulaire" action="">
    <applet name="jaxe" archive="JaxeApplet.jar,config/" code="jaxeapplet.JaxeApplet" width="10" height="10">
    <param name="config" value="config/XHTML_config.xml">
    Java is not enabled in your web browser
    <input type="button" value="Edit with Jaxe" onclick="editer()">
    <textarea name="texte" rows="20" cols="100">
    &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
    &lt;html xmlns=""&gt;

    The example in the developer guide is for a Java application, not a Java applet.

    You can also see the applet in action in WebJaxe ( ). Since you give an example with HTML, I have to say that I don't think Jaxe is the best HTML editor. Jaxe is better to edit documents with a semantic structure and markup, later to be transformed automatically into HTML for the web (or a CMS shortcuts if you want to use a CMS with a syntax that is neither XML nor HTML).
    FYI, I once tried to integrate the Jaxe applet into the SPIP CMS. I stopped developing that when I worked on WebJaxe, but it might be of interest to you. It's in French, but if you don't know any French you could use a translator to get the idea :
    google translation :


Log in to post a comment.