12.3 Action Commands

GUI context XML file

 <Frame visible="true"
        size="250,80"
        title="Hello Greetings" >
    <panel constraints="BorderLayout.CENTER">
       <button text="Greetings"
               ActionCommand="helloCommand"/>
    </panel>
 </Frame>
-_-_-

[Picture]

Application context XML file

 <bean id="helloCommand"
       class="org.swixat.commands.CommandBinder">
    <property name="output">
       <value>xatHelloWorld.xml</value>
    </property>
 </bean>
-_-_-
SwiXml Counterpart

 <button text="Greetings" Action="call"
                          ActionCommand="helloCommand"/>
-_-_-

 public Action call = new AbstractAction() {
   public void actionPerformed( ActionEvent e ) {
     if( e.getActionCommand().equals("helloCommand") ){
        try{
           new SwingEngine( this ).render( "xatHelloWorld.xml" )
                                  .setVisible( true );
        } catch ( Exception err){ System.err.println(err); }
 } } };
-_-_-