The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 Introducing JAXX: A New Way to Swing
Subject:  Interesting, but needs to go deeper
Date:  2006-03-30 12:04:17
From:  enicholas
Response to: Interesting, but needs to go deeper


JAXX objects can interact with application logic using ordinary Java code, i.e. <JButton text='Do Something' onActionPerformed='controller.doSomething()'/>

And as JAXX objects are ordinary Java classes, Java code can interact with them as well. You can either use script tags to define methods and fields for your application to interact with, or rely on the built-in getObjectById() method. For instance if you prefer to have all Java code live outside of your XML code, you could have something like:

<JButton id='doSomething' text='Do Something'/>

and then from Java use jaxxObject.getObjectById("doSomething") to get the button. At that point you can add an action listener to it, configure it further, or do whatever else you like to it. There is a lot more documentation on the web site if you're interested.

 Feed java.net RSS Feeds