diff options
-rw-r--r-- | src/com/itmill/toolkit/demo/HelloWorld.java | 54 |
1 files changed, 10 insertions, 44 deletions
diff --git a/src/com/itmill/toolkit/demo/HelloWorld.java b/src/com/itmill/toolkit/demo/HelloWorld.java index b6b40fcc11..d4ab04e486 100644 --- a/src/com/itmill/toolkit/demo/HelloWorld.java +++ b/src/com/itmill/toolkit/demo/HelloWorld.java @@ -1,12 +1,6 @@ package com.itmill.toolkit.demo; -import com.itmill.toolkit.data.Property.ValueChangeEvent; -import com.itmill.toolkit.data.Property.ValueChangeListener; -import com.itmill.toolkit.ui.Label; -import com.itmill.toolkit.ui.OrderedLayout; -import com.itmill.toolkit.ui.Panel; -import com.itmill.toolkit.ui.Slider; -import com.itmill.toolkit.ui.Window; +import com.itmill.toolkit.ui.*; /** * The classic "hello, world!" example for IT Mill Toolkit. The class simply @@ -20,7 +14,6 @@ import com.itmill.toolkit.ui.Window; */ public class HelloWorld extends com.itmill.toolkit.Application { - private Label value = new Label(); /** * The initialization method that is the only requirement for inheriting the * com.itmill.toolkit.service.Application class. It will be automatically @@ -34,43 +27,16 @@ public class HelloWorld extends com.itmill.toolkit.Application { */ Window main = new Window("Hello window"); setMainWindow(main); - - OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - setTheme("example"); - - Slider s = new Slider(); - s.setCaption("Volume"); - s.setMax(20); - s.setMin(12); - //s.setResolution(2); - s.setImmediate(true); - s.setOrientation(Slider.ORIENTATION_VERTICAL); - //s.setArrows(true); - s.setSize(200); - //s.addStyleName(Slider.STYLE_SCROLLBAR); - - s.addListener(new ValueChangeListener() { + /* + * - Create a label with the classic text - Add the label to the main + * window + */ + main.addComponent(new Label("Hello World!")); - public void valueChange(ValueChangeEvent event) { - value.setValue(event.getProperty().getValue()); - } - - }); - - ol.addComponent(s); - - Panel p = new Panel("Volume level"); - p.setHeight(400); - p.setHeightUnits(Panel.UNITS_PIXELS); - ((OrderedLayout)p.getLayout()).setMargin(false,true,true,false); - - p.addComponent(value); - ol.addComponent(p); - value.setValue(s.getValue()); - - ol.setComponentAlignment(s, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_BOTTOM); - - main.setLayout(ol); + /* + * And that's it! The framework will display the main window and its + * contents when the application is accessed with the terminal. + */ } } |