KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > InitClass


1
2 import org.swixml.SwingEngine;
3
4 import javax.swing.*;
5 import java.awt.event.ActionEvent JavaDoc;
6 import java.awt.event.WindowAdapter JavaDoc;
7
8 /**
9  * The InitClass class demonstrates how to use the initclass attribute.
10  * Date: Mar 10, 2003
11  *
12  * @author <a HREF="mailto:wolf@paulus.com">Wolf Paulus</a>
13  * @version $Revision: 1.1 $
14  * @since swixml 0.76
15  */

16
17 public class InitClass extends WindowAdapter JavaDoc {
18   public Action DO_SELECT = new AbstractAction() {
19     public void actionPerformed(ActionEvent JavaDoc e) {
20       System.out.println( ((JComboBox) e.getSource()).getSelectedItem().toString() );
21     }
22   };
23
24   private InitClass() throws Exception JavaDoc {
25     new SwingEngine( this ).render( "xml/initclass.xml" ).setVisible( true );
26   }
27
28   public static void main(String JavaDoc[] args) {
29     try {
30       new InitClass();
31     } catch (Exception JavaDoc e) {
32       e.printStackTrace();
33     }
34   }
35 }
36
37
Popular Tags