KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ClientAttr


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 ClientAttr shows in the usage of client attributes in swixml tags.
10  *
11  * @author <a HREF="mailto:wolf@paulus.com">Wolf Paulus</a>
12  * @version $Revision: 1.1 $
13  *
14  * @since swixml 0.98
15  */

16 public class ClientAttr extends WindowAdapter JavaDoc {
17   private SwingEngine swix = new SwingEngine( this );
18
19   public JButton btn;
20   public JTextArea ta;
21   public Action show = new AbstractAction() {
22     public void actionPerformed( ActionEvent JavaDoc e ) {
23       ta.setText( "X:" + btn.getClientProperty( "X" ) + "\n" + "Y:" + btn.getClientProperty( "Y" ) );
24     }
25   };
26
27   private ClientAttr() {
28     try {
29       swix.render( "xml/clientattr.xml" ).setVisible( true );
30       swix.forget( "x" );
31     } catch (Exception JavaDoc e) {
32       e.printStackTrace();
33     }
34   }
35
36   public static void main( String JavaDoc[] args ) {
37     new ClientAttr();
38   }
39 }
Popular Tags