1
2 import org.swixml.SwingEngine;
3
4 import javax.swing.*;
5 import java.awt.event.ActionEvent;
6
7 public class HelloWorld {
8
9 private int clicks;
10
11
12 public JTextField tf;
13
14
15 public JLabel cnt;
16
17
18 public Action submit = new AbstractAction() {
19 public void actionPerformed( ActionEvent e ) {
20 tf.setText( tf.getText() + '#' );
21 cnt.setText(String.valueOf( ++clicks ));
22 }
23 };
24
25
26 private HelloWorld() throws Exception {
27 new SwingEngine( this ).render( "xml/helloworld.xml" ).setVisible( true );
28 }
29
30
31 public static void main( String[] args ) throws Exception {
32 new HelloWorld();
33 }
34}
35