01: package org.millstone.examples;
02:
03: import org.millstone.base.ui.*;
04:
05: /** The classic "hello, world!" example for the MillStone framework. The
06: * class simply implements the abstract
07: * {@link org.millstone.base.Application#init() init()} method
08: * in which it creates a Window and adds a Label to it.
09: *
10: * @author IT Mill Ltd.
11: * @see org.millstone.base.Application
12: * @see org.millstone.base.ui.Window
13: * @see org.millstone.base.ui.Label
14: */
15: public class HelloWorld extends org.millstone.base.Application {
16:
17: /** The initialization method that is the only requirement for
18: * inheriting the org.millstone.base.service.Application class. It will
19: * be automatically called by the framework when a user accesses the
20: * application.
21: */
22: public void init() {
23:
24: /*
25: * - Create new window for the application
26: * - Give the window a visible title
27: * - Set the window to be the main window of the application
28: */
29: Window main = new Window("Hello window");
30: setMainWindow(main);
31:
32: /*
33: * - Create a label with the classic text
34: * - Add the label to the main window
35: */
36: main.addComponent(new Label("Hello World!"));
37:
38: /*
39: * And that's it! The framework will display the main window and its
40: * contents when the application is accessed with the terminal.
41: */
42: }
43: }
44:
45: /* This Millstone sample code is public domain. *
46: * For more information see www.millstone.org. */
|