1 
2 import org.swixml.ConverterLibrary;
3 import org.swixml.SwingEngine;
4 
5 import java.util.TimeZone;
6 
7 /**
8  * Extend the TagLib with a new Class and a new Converter
9  */
10public 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.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 e) {
25      System.err.println( e.getMessage() );
26    }
27
28    try {
29      render( "xml/newtag.xml" ).setVisible( true );
30    } catch (Exception e) {
31      e.printStackTrace();
32    }
33  }
34
35  public static void main(String[] args) {
36    new NewTag();
37  }
38}
39