1 2 import org.swixml.SwingEngine; 3 4 import javax.swing.*; 5 import java.awt.event.ActionEvent ; 6 7 15 public class Accelerator { 16 private static final String DESCRIPTOR = "xml/accelerator.xml"; 17 SwingEngine swix = new SwingEngine( this ); 18 19 public Accelerator() throws Exception { 20 swix.render( Accelerator.DESCRIPTOR ).setVisible( true ); 21 } 22 23 public Action newAction = new AbstractAction() { 24 public void actionPerformed( ActionEvent e ) { 25 JOptionPane.showMessageDialog( swix.getRootComponent(), "Sorry, not implemented yet." ); 26 } 27 }; 28 29 public Action aboutAction = new AbstractAction() { 30 public void actionPerformed( ActionEvent e ) { 31 JOptionPane.showMessageDialog( swix.getRootComponent(), "This is the Accelerator Example." ); 32 } 33 }; 34 35 public static void main( String [] args ) { 36 try { 37 new Accelerator(); 38 } catch (Exception e) { 39 System.err.println( e.getMessage() ); 40 } 41 } 42 43 } 44 | Popular Tags |