01: /*
02: * Javu WingS - Lightweight Java Component Set
03: * Copyright (c) 2005-2007 Krzysztof A. Sadlocha
04: * e-mail: ksadlocha@programics.com
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20:
21: package helloworld;
22:
23: import java.awt.GridBagLayout;
24: import com.javujavu.javux.wings.WingApplet;
25: import com.javujavu.javux.wings.WingButton;
26: import com.javujavu.javux.wings.WingComponent;
27: import com.javujavu.javux.wings.WingPanel;
28: import com.javujavu.javux.wings.WingSkin;
29:
30: public class HelloWorldApplet extends WingApplet {
31: public void start() {
32: // at first load skin !
33: // from directory skin/green relative to class file of HelloWorldApplet
34: WingSkin.loadSkin("/skin/green", true, HelloWorldApplet.class);
35: //and update applet look
36: WingComponent.updateSkin(this );
37:
38: // build simple content panel
39: WingPanel panel = new WingPanel(new GridBagLayout());
40: // with one button
41: panel.add(new WingButton("Hello World"));
42:
43: // and finally show it in applet
44: setContentPane(panel);
45: }
46: }
|