This applet uses DOM to read XML files and DOM4j to write XML files.
DOM4j: http://sourceforge.net/projects/dom4j
1. Applet main program mainFrame. java
Package frame;
/**
* @ Author wls
*/
Import java. applet .*;
Import java. awt .*;
Import java. awt. event .*;
Public class mainFrame
Extends Applet {
DomXml domxml = new DomXml ();
Button btnExit = new Button ("Exit ");
Button btnRun = new Button ("Save ");
Label lblMain = new Label ("dynamicroute. xml configuration file ");
Label lblSiteinfo = new Label ("srcserverid :");
Label lblPath = new Label ("destserverid :");
Label lblFilename = new Label ("switchserver :");
Label lblSession = new Label ("metric :");
Label lblSuccess = new Label ("");
TextField txtSiteinfo = new TextField (domxml. getSrcserverid (), 10 );
TextField txtPath = new TextField (domxml. getDestserverid (), 10 );
TextField txtFilename = new TextField (domxml. getSwitchserver (), 10 );
TextField txtSession = new TextField (domxml. getMetric (), 10 );
Panel p6 = new Panel ();
Panel p1 = new Panel ();
Panel p2 = new Panel ();
Panel p3 = new Panel ();
Panel p4 = new Panel ();
Panel p5 = new Panel ();
Panel p7 = new Panel ();
Panel p8 = new Panel ();
Public void init (){
Resize (400,300 );
P6.add (lblMain );
P1.add (lblSiteinfo );
P1.add (txtSiteinfo );
P2.add (lblPath );
P2.add (txtPath );
P3.add (lblSession );
P3.add (txtSession );
P4.add (btnRun );
P4.add (btnExit );
P5.add (lblFilename );
P5.add (txtFilename );
P8.add (lblSuccess );
SetLayout (new GridLayout (4, 2, 1, 1 ));
Add (p6 );
Add (p7 );
Add (p1 );
Add (p2 );
Add (p5 );
Add (p3 );
Add (p4 );
Add (p8 );