KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > NewTag


1
2 import org.swixml.ConverterLibrary;
3 import org.swixml.SwingEngine;
4
5 import java.util.TimeZone JavaDoc;
6
7 /**
8  * Extend the TagLib with a new Class and a new Converter
9  */

10 public class NewTag extends SwingEngine {
11
12   private NewTag() {
13     //
14
// Register a new new Converter,
15
// Generally, Converters should be regsitered before Tags
16
//
17
ConverterLibrary.getInstance().register( TimeZone JavaDoc.class, new TimeZoneConverter() );
18     //
19
// Register a Tag that uses a SwingEngine itself ...
20
//
21
this.getTaglib().registerTag( "xpanel", XPanel.class );
22     try {
23       this.getTaglib().registerTag( "redlabel", RedLabel.class );
24     } catch (Exception JavaDoc e) {
25       System.err.println( e.getMessage() );
26     }
27
28     try {
29       render( "xml/newtag.xml" ).setVisible( true );
30     } catch (Exception JavaDoc e) {
31       e.printStackTrace();
32     }
33   }
34
35   public static void main(String JavaDoc[] args) {
36     new NewTag();
37   }
38 }
39
Popular Tags